Page 1 sur 1

Jpgraph problème d'affichage

Posté : 30 nov. 2010, 11:19
par Roro44
Bonjour,
value->Show() ne m'affiche pas les valeurs au dessus des barres.
Sous Easyphp 1.7 et jpgraph 1.4 tout fonctionne bien.
Sous Wampserver et jpgraph 3.5 cela ne marche par. Par contre tout le reste de mon graphe s'affiche parfaitement bien.
Ci joint le code

Code : Tout sélectionner

<?php include ("jpgraph/jpgraph.php"); include ("jpgraph/jpgraph_bar.php"); //========================================================================================================= // Remplissage des tableaux include("SourcesPhp/Connexion.php"); Connexion(); $reqcher="select * from BNKCourbeCentreNature where CodeCentre='$CodeCentre'"; $resultat=@mysql_query($reqcher); $row=mysql_fetch_array($resultat); $AxeDesX=array("Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"); $AxeDesY1=array(); $AxeDesY2=array(); $AxeDesY1[0]=$row[ValD01]; $AxeDesY1[1]=$row[ValD02]; $AxeDesY1[2]=$row[ValD03]; $AxeDesY1[3]=$row[ValD04]; $AxeDesY1[4]=$row[ValD05]; $AxeDesY1[5]=$row[ValD06]; $AxeDesY1[6]=$row[ValD07]; $AxeDesY1[7]=$row[ValD08]; $AxeDesY1[8]=$row[ValD09]; $AxeDesY1[9]=$row[ValD10]; $AxeDesY1[10]=$row[ValD11]; $AxeDesY1[11]=$row[ValD12]; $AxeDesY2[0]=$row[ValC01]; $AxeDesY2[1]=$row[ValC02]; $AxeDesY2[2]=$row[ValC03]; $AxeDesY2[3]=$row[ValC04]; $AxeDesY2[4]=$row[ValC05]; $AxeDesY2[5]=$row[ValC06]; $AxeDesY2[6]=$row[ValC07]; $AxeDesY2[7]=$row[ValC08]; $AxeDesY2[8]=$row[ValC09]; $AxeDesY2[9]=$row[ValC10]; $AxeDesY2[10]=$row[ValC11]; $AxeDesY2[11]=$row[ValC12]; //======================================================================================================== // Create the graph. These two calls are always required $graph = new Graph(1000, 600,"auto"); $graph->SetScale( "textlin"); // Add a drop shadow $graph->SetShadow(); // Adjust the margin a bit to make more room for titles $graph->img->SetMargin(60,40,20,50); $graph->SetMarginColor('azure2'); // Setup the titles $graph->title->Set("REPARTITION MENSUELLE"); $graph->title->SetColor('darkred'); $graph->xaxis->title->Set("Mois"); $graph->xaxis->title->SetColor('darkred'); $graph->yaxis->title->Set("Soldes"); $graph->yaxis->title->SetColor('darkred'); $graph->xaxis->SetTickLabels($AxeDesX); $graph->yaxis->scale->SetGrace(10); // Create a bar pot $bplot1 = new BarPlot($AxeDesY1); $bplot1->value->Show(); $bplot1->value->SetFormat("%0.2f"); $bplot2 = new BarPlot($AxeDesY2); $bplot2->value->Show(); $bplot2->value->SetFormat("%0.2f"); // Adjust fill color $bplot1->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDVER); $bplot1->SetColor('navy'); $bplot1->SetWidth(1.0); $bplot2->SetFillGradient("forestgreen","lawngreen",GRAD_WIDE_MIDVER); $bplot2->SetColor('navy'); $bplot2->SetWidth(1.0); $gbplot = new GroupBarPlot(array($bplot1,$bplot2)); $graph->Add($gbplot); // Display the graph $graph->Stroke(); ?>

Re: Jpgraph problème d'affichage

Posté : 30 nov. 2010, 14:50
par Roro44
Problème résolu en installant la version 3.0.7 au lieu de la version 3.5.1