Bonjour,
J'ai mis en place un drupal, à partir de là, j'ai créé une page dans laquel, il y a un formulaire, la personne sélectionne le type de graph qu'elle veut.
Mon souci est que je n'arrive pas à affiche les graphes.
Au début, j'avais l'erreur l'image ne peut-être affiché...
Alors j'ai suivi le lien ci-dessous.
J'ai trouvé une solution à une partie de mon problème sauf qu'en la faisant, elle m'en a crée d'autre.
voici le lien qui m'a aidé
http://www.developpez.net/forums/d46...tient-erreurs/
Maintenant, j'ai une autre erreur :
JpGraph Error: 25107 Can't write to file Check that the process running PHP has enough permission.
Alors voici mon formulaire
mon script php de vérification que j'inclue dans la même page que le formulaire :
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 <form method="post"> <h1>Choix du graphique</h1> <br> <TABLE BORDER=0> <TR> <TD>Division</TD> <TD> <SELECT name="division"> <OPTION VALUE="CASQY">CASQY</OPTION> <OPTION VALUE="DLJ">DLJ</OPTION> <OPTION VALUE="HQ">HQ</OPTION> </SELECT> <TD>Graphe</TD> <TD> <SELECT name="graphe"> <OPTION VALUE="version_agent">Version Agent</OPTION> <OPTION VALUE="version_moteur">Version Moteur</OPTION> <OPTION VALUE="version_viruscan">Version viruscan</OPTION> <OPTION VALUE="wsus">WSUS</OPTION> ordinateur</OPTION> </SELECT> <TD>Date</TD> <TD> <SELECT name="date"> <OPTION VALUE="2009-10-14">2009-10-14</OPTION> </SELECT> </TD> </TD> </TD> </TR> <TR > <TD COLSPAN=2> <INPUT type="submit" name="envoyer" value="Envoyer"> </TD> </TR> </TABLE> </FORM> <img src="jpgraph/version_agent.php" width="240" height="240" /> <img src="jpgraph/version_moteur.php" width="240" height="240" /> <img src="jpgraph/version_viruscan.php" width="240" height="240" />
version_agent.php ou version_moteur.php ou version_viruscan.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <?php extract($_POST); if (isset($_POST['envoyer'])) { if(!empty($division)&& !empty($graphe)&& !empty($date)) { $php = ".php"; $fichier=$graphe. '.php'; include("jpgraph/$fichier"); } } ?>
j'appelle ce fichier
En fonction du graphe qu'il veut :
Code : Sélectionner tout - Visualiser dans une fenêtre à part include("jpgraph/$fichier");
Que dois-je faire ?
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
72
73
74
75
76 <?php include ("../../../../home/packages/src/jpgraph.php"); include ("../../../../home/packages/src/jpgraph_bar.php"); //$db=pg_connect("host=localhost user=postgres password=password") || die ("Connexion impossible"); $db = pg_connect("host=localhost port=5432 ") or die("Connexion impossible"); $result = pg_query($db, "SELECT $graphe, nb_poste FROM $graphe WHERE date_ajout='$date' AND unite='$division'"); if (!$result) { echo "Une erreur s'est produite.\n"; exit; } $tabvm = array(); $nbposte = array(); while($row = pg_fetch_assoc($result)) { $tabvm[] = $row[$graphe]; $nbposte[] = $row['nb_poste']; } //printf('<pre>%s</pre>',print_r($tabvm,1)); //printf('<pre>%s</pre>',print_r($nbposte,1)); //header ("Content-type: image/png"); // Construction du conteneur // Spéfication largeur et hauteur $graph = new Graph(400,350); // Rééntation linére $graph->SetScale("textlin"); // Ajouter une ombre au conteneur $graph->SetShadow(); // Fixer les marges $graph->img->SetMargin(40,30,25,40); // Créion du graphique histogramme $bplot = new BarPlot($nbposte); // Spéfication des couleurs des barres $bplot->SetFillColor(array('red', 'green', 'blue')); // Une ombre pour chaque barre $bplot->SetShadow(); // Afficher les valeurs pour chaque barre $bplot->value->Show(); // Fixer l'aspect de la police $bplot->value->SetFont(FF_ARIAL,FS_NORMAL,9); // Modifier le rendu de chaque valeur $bplot->value->SetFormat('%d poste'); // Ajouter les barres au conteneur $graph->Add($bplot); // Le titre $graph->title->Set("Indicateurs $division Version Agent"); $graph->title->SetFont(FF_FONT1,FS_BOLD); // Titre pour l'axe horizontal(axe x) et vertical (axe y) $graph->xaxis->title->Set("version agent"); $graph->yaxis->title->Set("nombre de poste"); $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); // Lénde pour l'axe horizontal $graph->xaxis->SetTickLabels($tabvm); $fichier=$graphe. '.php'; // Afficher le graphique $graph->Stroke($fichier); //Stroke('$fichier.jpg');
J'ai même mis chmod 777 au répertoire où il y a les fichiers version...
ça ne marche pas quel est le soucis ?
Partager