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 13/07/2007, 17h09   #1
Invité de passage
 
Inscription : décembre 2005
Messages : 36
Détails du profil
Informations forums :
Inscription : décembre 2005
Messages : 36
Points : 4
Points : 4
Par défaut [JpGraph] Problème d'affichage d'erreurs

Bonjour,

Je construit un graph à partir d'un id (plus eventuellement un idMoteur)

Lorsque je n'utilise que l'id le graph s'affiche sinon il m'indique que l'image ne peut etre affichée car elle contient des erreurs.
Pourtant mon code semble correcte :

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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$sql = "select * from PACK where ID_PACK = " . intval($_GET['id']);
$filtre = "ID_PACK = " . intval($_GET['id']);
$rs = mssql_query($sql) or die(erreurSQL($sql));
if ($row = @mssql_fetch_array($rs)) {
	check_contrat($row['ID_CONTRAT']); //compatibilité avec le FR
 
	$sql = "select * from PACKPOSITIONNEMENT where $filtre and POS_VISIBLE=1 and POS_VALIDE=1 order by POS_DATE";
	$rsListe = mssql_query($sql) or die(erreurSQL($sql)); 
	$aTop1 = $aTop10 = $aTop20 = $aLabel = array();
	$POS_NBREQUETE = 0;
	while($rowListe = @mssql_fetch_array($rsListe)) {
		$aTop1[] = $rowListe['POS_NBTOP1'];
		$aTop10[] = $rowListe['POS_NBTOP10'];
		$aTop20[] = $rowListe['POS_NBTOP20'];
		$aLabel[] = strftime("%B %Y ", $rowListe['POS_DATE']);
		if ($POS_NBREQUETE < $rowListe['POS_NBREQUETE']) $POS_NBREQUETE = $rowListe['POS_NBREQUETE'];
	}
 
	$graph = new Graph(760, 400, 'auto');	
	$graph->SetScale("textlin", 0, $POS_NBREQUETE);
	$graph->img->SetMargin(50,10,30,120);
	$graph->SetMarginColor('white');
 
	$graph->xaxis->SetTickLabels($aLabel);
	$graph->xaxis->SetLabelAngle(90);
 
	$graph->legend->SetPos(0.5, 0.01, "center", "top");	
	$graph->legend->SetLayout(LEGEND_HOR);
	$graph->legend->SetShadow(false); 
 
	$lineplot3 = new LinePlot($aTop20);
	$lineplot3->SetColor(array(233, 131, 116));
	$lineplot3->SetFillColor(array(233, 131, 116));
  $lineplot3->SetStyle(1); 
	$lineplot3->SetWeight(2);
	$lineplot3->SetLegend("Top 20");
	$graph->Add($lineplot3);
 
	$lineplot2 = new LinePlot($aTop10);
	$lineplot2->SetColor(array(255, 255, 128));
	$lineplot2->SetFillColor(array(255, 255, 128));
  $lineplot2->SetStyle(1); 
	$lineplot2->SetWeight(2);
	$lineplot2->SetLegend("Top 10");
	$graph->Add($lineplot2);
 
	$lineplot = new LinePlot($aTop1);
	$lineplot->SetColor(array(150, 205, 143));
	$lineplot->SetFillColor(array(150, 205, 146));
  $lineplot->SetStyle(1); 
	$lineplot->SetWeight(2);
	$lineplot->SetLegend("Top 1");
	$graph->Add($lineplot);
 
  if (isset($_GET['idConcurrent'])){
    $sql = "select * from PACKPOSITIONNEMENT where ID_PACKCONCURRENT = " . intval($_GET['idConcurrent']) . " 
            and POS_VISIBLE=1 and POS_VALIDE=1 order by POS_DATE";print_r($sql);
    $rsListe = mssql_query($sql) or die(erreurSQL($sql)); 
  	$aTop1 = $aTop10 = $aTop20 = array();
  	while($rowListe = @mssql_fetch_array($rsListe)) {
  		$aTop1[] = $rowListe['POS_NBTOP1'];
  		$aTop10[] = $rowListe['POS_NBTOP10'];
  		$aTop20[] = $rowListe['POS_NBTOP20'];
  	}
 
  	$lineplot6 = new LinePlot($aTop20);
  	$lineplot6->SetColor("black");
  	$lineplot6->SetStyle(3); 
  	$lineplot6->SetWeight(2);
  	$graph->Add($lineplot6);
 
  	$lineplot5 = new LinePlot($aTop10);
  	$lineplot6->SetColor("black@0.5");
  	$lineplot5->SetStyle(3); 
  	$lineplot5->SetWeight(2);
  	$graph->Add($lineplot5);
 
  	$lineplot4 = new LinePlot($aTop1);
  	$lineplot6->SetColor("black@0.9");
  	$lineplot4->SetStyle(3); 
  	$lineplot4->SetWeight(2);
  	$graph->Add($lineplot4);  
  }
 
	$graph->Stroke();
}
voyez vous mon erreur? ou pouvez vous m'indiquer si je peux débugger en affichant une erreur plus précise parce que je suis un peu dans le flou

MERCI
cbv38 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/07/2007, 10h55   #2
Invité de passage
 
Inscription : décembre 2005
Messages : 36
Détails du profil
Informations forums :
Inscription : décembre 2005
Messages : 36
Points : 4
Points : 4
J'ai trouvé mon erreur..
C'était uniquement un oubli de suppression de 'print_r()'
cbv38 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 17h04.


 
 
 
 
Partenaires

Hébergement Web