SVP j'arrive pas à comprendre pourquoi ce script ne m'affiche le resultat sachant que la connexion à la base de données est bon, aussi la requête à bien passé tout fonctionne mais j'obtiens un petit icone d'une image .Merci trop bien pour votre réponse.


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
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
 
<?php
include '../jpgraph/src/jpgraph.php';
include '../jpgraph/src/jpgraph_line.php';
include '../commande/commande.php';
include '../connexionDB.php';
 
// *********************
// Production de données
// *********************
 
$tx=array();
$rx=array();
$temps=array();
 
 
 
$req="SELECT tx,rx,time,date FROM interfaces WHERE id_server='1' AND nom_int='eth0';";
if($result = mysql_query($req)){
while($ligne = mysql_fetch_array($result)){
$tx[]=$ligne[0];
$rx[]=$ligne[1];
$temps[]=$ligne[2]."\n".$ligne[3];
 
}}
$graph = new Graph(900,500);
$graph->img->SetMargin(40,30,50,40);    
$graph->img->SetAntiAliasing("white");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set('eth0');
 
$graph->ygrid->Show();
$graph->ygrid->SetColor('blue@0.7');
$graph->ygrid->SetLineStyle('dashed');
 
 
$graph->xgrid->Show();
$graph->xgrid->SetColor('red@0.7');
$graph->xgrid->SetLineStyle('dashed');
 
 
$graph->title->SetFont(FF_ARIAL,FS_BOLD,11);
 
 
$courbeTx = new LinePlot($tx);
$courbeTx->value->Show();
$courbeTx->SetLegend('tx');
$courbeTx->SetColor("blue");
$courbeTx->SetCenter();
 
$courbeRx = new LinePlot($rx);
$courbeRx->value->Show();
$courbeRx->SetLegend('rx');
$courbeRx->SetColor("red");
$courbeRx->SetCenter();
 
 
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->SetTitle("Block");
 
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->SetTickLabels($temps);
$graph->xaxis->SetTextLabelInterval(5);
 
// Ajouter la courbe au conteneur
$graph->Add($courbeRx);
$graph->Add($courbeTx);
 
$graph->Stroke();
?>