Page 1 sur 1

coube jpgraph

Posté : 28 juin 2013, 17:56
par aisha91
Bonjour,
j'ai créer un courbe avec jpgraph et il fonctionne bien voila le code :
<?php 
include ("jpgraph.php"); 
include ("jpgraph_line.php"); 
//connexion au localhost et à la base de donnée 
include ('cnx.php'); 
// de l'envoi des deux dates 
// La requettes 
$req = "select count(id),date_demande from educatelWP_demande_documentation group by date_demande"; 
$res=mysql_query($req); 
$tableauElement = array(); 
$tableauNb = array(); //les modifs ici 
while ($ligne=mysql_fetch_array($res)) 
{ 
$tableauElement[] = $ligne['count(id)']; 
$tableauNb[] = $ligne['date_demande']; 
} 
// content="text/plain; charset=utf-8" 
// Setup the graph 
$graph = new Graph(920,400); 
$graph->SetScale("textlin"); 
$theme_class=new UniversalTheme; 
$graph->SetTheme($theme_class); 
$graph->img->SetAntiAliasing(false); 
$graph->title->Set(' '); 
$graph->SetBox(false); 
$graph->img->SetAntiAliasing(); 
$graph->yaxis->HideZeroLabel(); 
$graph->yaxis->HideLine(false); 
$graph->yaxis->HideTicks(false,false); 
$graph->xgrid->Show(); 
$graph->xgrid->SetLineStyle("solid"); 
$graph->xaxis->SetTickLabels($tableauNb); //les modifs ici aussi 
$graph->xgrid->SetColor('#E3E3E3'); 
// Create the line 
$p1 = new LinePlot($tableauElement); 
$graph->Add($p1); 
$p1->SetColor("#6495ED"); 
$p1->SetLegend('Avancement Demande documentation'); 
$graph->legend->SetFrameWeight(1); 
$graph->img->SetImgFormat('png'); 
$graph->Stroke("courbe.png"); // ici pour definir l'image de sortie 
// Output line 
echo ('<img src="courbe.png">'); // afficher l'image 
?>

mais le probléme qui je veux afficher 2 graphique dans une page et ça fonctionne pas ,, n'hésitez pas à me répondre SVP

Re: coube jpgraph

Posté : 28 juin 2013, 19:47
par moogli
salut,

utilise deux objets différents (et des variables différentes).


@+