Courbe php
aisha91
-
mpmp93 Messages postés 6648 Date d'inscription Statut Membre Dernière intervention -
mpmp93 Messages postés 6648 Date d'inscription Statut Membre Dernière intervention -
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
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
A voir également:
- Courbe php
- Courbe excel - Guide
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Courbe des prix amazon - Guide
- Graphique courbe en ligne - Guide
1 réponse
Bonjour,
je n'utilise plus JPGRAPH mais RGRAPH:
https://html5.immo-scope.com/article/rgraph_debuter
plus simple...
A+
je n'utilise plus JPGRAPH mais RGRAPH:
https://html5.immo-scope.com/article/rgraph_debuter
plus simple...
A+