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] Erreur JPGraph


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 28
    Par défaut [JpGraph] Erreur JPGraph
    Bonjour a tous,

    J'essaie d'afficher un graph et cela ne marche pas...pourant mon code me semble correct.
    le voici et plus bas l'erreur qui s'affiche.

    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
    // Data must be in the format : open,close,min,max,median
    $datay = array(2,2,4,5,5);
     
    // Setup a simple graph
    $graph = new Graph(300,200);
    $graph->SetScale("textlin");
    $graph->SetMargin(60,60,50,30);
    $graph->title->Set($titre);
     
    // Create a new stock plot
    $p1 = new BoxPlot($datay);
     
    // Width of the bars (in pixels)
    $p1->SetWidth(9);
     
    // Uncomment the following line to hide the horizontal end lines
    //$p1->HideEndLines();
     
    // Add the plot to the graph and send it back to the browser
    $graph->Add($p1);
    $graph->Stroke();
     
    	$graph->Add($p1);
    	$graph->img->SetImgFormat('png');
    	$graph->img->SetQuality(50);
    	//$graph->legend->SetFont(FF_FONT1,FS_NORMAL,20);//pour petite légende en bas
    	//$graph->legend->Pos(0.03,0.3);//pour petite légende en bas
    	$graph->Stroke("pubparanif.png");

    JpGraph Error A plot has an illegal scale. This could for example be that you are trying to use text autoscaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x')


    Merci

  2. #2
    Membre Expert
    Avatar de yiannis
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 494
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 494
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // Create a new stock plot
    $p1 = new BoxPlot($datay);
     
    // Width of the bars (in pixels)
    $p1->SetWidth(9);
     
    // Uncomment the following line to hide the horizontal end lines
    //$p1->HideEndLines();
     
    // Add the plot to the graph and send it back to the browser
    $graph->Add($p1);
    $graph->Stroke();
    la tu fais un Stroke, c'est a dire que tu affiches ton graphe mais tu ne lui pas rentre de valeurs. Tu le fais plus bas
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
       $graph->Add($p1);
       $graph->img->SetImgFormat('png');
       $graph->img->SetQuality(50);
       //$graph->legend->SetFont(FF_FONT1,FS_NORMAL,20);//pour petite légende en bas
       //$graph->legend->Pos(0.03,0.3);//pour petite légende en bas
       $graph->Stroke("pubparanif.png");
    fais un seul Stroke et seulement apres avoir fait $graph->Add($p1)

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 28
    Par défaut
    merde le con, j'avais pas fais attention..
    j'ai corriger le problème de stroke mais j'ai toujour la meme erreur...et je ne comprend pas le sens exact


    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
    // Data must be in the format : open,close,min,max,median
    $datay = array(2,2,4,5,5);
     
    // Setup a simple graph
    $graph = new Graph(300,200);
    $graph->SetScale("textlin");
    $graph->title->Set($titre);
     
    // Create a new stock plot
    $p1 = new BoxPlot($datay);
     
    // Width of the bars (in pixels)
    $p1->SetWidth(9);
     
    // Add the plot to the graph and send it back to the browser
    	$graph->Add($p1);
    	$graph->img->SetImgFormat('png');
    	$graph->img->SetQuality(50);
    	$graph->Stroke("pubparanif.png");
    	return "pubparanif.png";

  4. #4
    Membre Expert
    Avatar de yiannis
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 494
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 494
    Par défaut
    es tu sur de ca?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     $graph->Stroke("pubparanif.png");
    return "pubparanif.png";
    moi je ne fais que :
    puis apres, j'appelle mon graphe, dans une page, de cette facon:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <img src='mongraph.php' border='0' align='center'>

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 28
    Par défaut
    je le fais pour tous mes autres graph et je n'ai jamais eut de souci avec ça !
    voilà comment je l'appel :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    echo"<CENTER>";
    	echo"<IMG SRC=\"".pubparanif("","",$listeService,"","","",$deb,$fin,$chaine)."\">";//afficher graphique
    	echo"</CENTER>";


    et voila la fonction :

    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    function pubparanif($auteur,$ini,$service,$equipe,$cnu,$cli,$deb,$fin,$chaine)
    {
    $rand1=rand(0,9);$rand2=rand(0,9);$rand3=rand(0,9);$rand4=rand(0,9);$rand5=rand(0,9);$rand6=rand(0,9);
     $rand="$rand1$rand2$rand3$rand4$rand5$rand6";
     
    $periode="période : $deb - $fin";
    	if($auteur!="")	//on vient de stataut.php
    	  $titre="Auteur : $auteur  $ini";
    	elseif($service!="") //on vient de statservice.php
    	      $titre="Service(s) : $service";
    	    elseif($equipe!="")  //on vient de statequipe.php
    	          $titre="Equipe(s) : $equipe";
    	      elseif($cnu!="")  //on vient de statcnu.php
    	          $titre="Diclipline(s) : $cnu";
    	        elseif($cli!="")  //on vient de statcnu.php
    	          $titre="Clinique(s) : $cli";
        	         else{
        	          $titre="Correspond au PMID enregistrés"; 
        						$periode ="";
        						 }
     
    // Data must be in the format : open,close,min,max,median
    $datay = array(2,2,4,5,5);
     
    // Setup a simple graph
    $graph = new Graph(300,200);
    $graph->SetScale("textlin");
    //$graph->SetMargin(60,60,50,30);
    $graph->title->Set($titre);
     
    // Create a new stock plot
    $p1 = new BoxPlot($datay);
     
    // Width of the bars (in pixels)
    $p1->SetWidth(9);
     
    // Add the plot to the graph and send it back to the browser
    	$graph->Add($p1);
    	$graph->img->SetImgFormat('png');
    	$graph->img->SetQuality(50);
    	$graph->Stroke("pubparanif$rand.png");
    	return "pubparanif$rand.png";
     
    }

  6. #6
    Membre Expert
    Avatar de yiannis
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 494
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 494
    Par défaut
    bon ce message semble indique que tu as une valeur nulle (0) ou negative.
    quel est le tableau de valeurs que tu rentre a jpgraphe? $datay ?? Si non, verifies les valeurs envoyees.

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 28
    Par défaut
    yé bon, j'ai trouvé... merci a toi

    en faite le problème venait de mon tableau

  8. #8
    Membre Expert
    Avatar de yiannis
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 494
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 494
    Par défaut
    ok, la soluce m'interresse et si c'est ok pense a mettre le tag

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 28
    Par défaut
    le problème venait de mon tableau en paramètre... le $datay, les données n'était pas correctement rentré!

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

Discussions similaires

  1. [JPGraph]Erreur, image non supportée
    Par Jim_Nastiq dans le forum Bibliothèques et frameworks
    Réponses: 3
    Dernier message: 18/07/2006, 15h28
  2. [JpGraph] Erreur avec setAngle dans JPGRAPH ?
    Par haffouff dans le forum Bibliothèques et frameworks
    Réponses: 6
    Dernier message: 23/05/2006, 15h26
  3. [JpGraph] Erreur avec JPGRAPH
    Par voileuxyann dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 25/04/2006, 11h13
  4. [JpGraph] Erreur liée au support TTF inactif
    Par crazydiver_e2 dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 19/01/2006, 17h27
  5. [JpGraph] Erreur lors de la mise en place chez Free
    Par florent dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 01/01/2006, 17h11

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