Sinse2004
Messages postés21Date d'inscriptionlundi 14 juin 2004StatutMembreDernière intervention23 août 2004
-
2 juil. 2004 à 16:45
bizerta
Messages postés2Date d'inscriptionmercredi 15 novembre 2000StatutMembreDernière intervention18 mai 2005
-
18 mai 2005 à 16:31
Salut,
J`essaye de faire des graphiques pour editer des stats a partir de ma BD MySQL, et on ma dit d`utiliser JPGRAPH(car super facile d`utilisation!!....pas pour moi en tout cas! ;-)
Bon, grace a un copier-coller(d`un script php trouver sur un forum), j`arrive a afficher un graphique. MAIS comment faire pour en afficher plusieurs sur la meme page??
Voila mon code ki permet l`affichage d`un graphique:
<?
include("config.php");
include ( "./JPGRAPH/src/jpgraph.php");
include ("./JPGRAPH/src/jpgraph_pie.php");
//include ("./JPGRAPH/src/jpgraph_line.php");
$SQL = "SELECT count(id_cr), status FROM cr_status GROUP BY status";
$RESULT = mysql_query($SQL);
if ($myrow=mysql_fetch_array($RESULT)) {
do {
$data[] = $myrow[0]; //It would not create the graphs without using '[]'
$data_names[] = $myrow[1]."(".$myrow[0].")";
}while ($myrow=mysql_fetch_array($RESULT));
}
// Create the Pie Graph.
$graph = new PieGraph(520,400,$filename,60);
$graph->SetShadow();
$PIE_TITLE="Graphique of the status of the CR";
// Set A title for the plot
$graph->title->Set($PIE_TITLE);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot($data);
$p1->SetCenter(0.35,0.5);
$p1->SetLegends($data_names);
Sinse2004
Messages postés21Date d'inscriptionlundi 14 juin 2004StatutMembreDernière intervention23 août 2004 5 juil. 2004 à 13:41
Salut,
ben en fait , j`arrive pas a afficher 2 graphiques sur la meme page !
Apres le code ci-dessus, je mets ca:...
$SQL = "SELECT id_dc, name_dc FROM data_center";
$RESULT = mysql_query($SQL);
if ($myrow=mysql_fetch_array($RESULT)) {
do {
$data2[] = $myrow[0]; //It would not create the graphs without using '[]'
$data_names2[] = $myrow[1]."(".$myrow[0].")";
}while ($myrow=mysql_fetch_array($RESULT));
}
// Create the Pie Graph.
$graph = new PieGraph(520,400,$filename,60);
$graph->SetShadow();
$PIE_TITLE="Graphique of the data center";
// Set A title for the plot
$graph->title->Set($PIE_TITLE);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p2 = new PiePlot($data2);
$p2->SetCenter(0.35,0.5);
$p2->SetLegends($data_names2);
$p2->SetTheme("earth");
$graph->Add($p2);
$graph->Stroke();
....et ca m`affiche simplement le dernier graphe, le premier ne s`affiche pas ! Ca doit etre un truc tout be-bete, mais j`y arrive. Si tu peux m`aider, ca serait cool,
Merci
dounit
Messages postés20Date d'inscriptionmardi 19 avril 2005StatutMembreDernière intervention10 mai 2005 16 mai 2005 à 15:06
bonjour je suis débutante en php et moi aussi je dois utiliser des
graphe.jé installer GPGraph mé je ne sé pas commen tl'utiliser ni ou le
mettre sur mon disque vous voulez bien m'aider merci