Bonjour à tous,
Voilà mon petit problème :
je crée des graphiques avec JpGraph pour le besoin d'une entreprise. Tous les graphes s'affichent correctement et JpGraph est un outil performant. Mais je n'arrive pas à insérer un fond au graphique avec la fonction SetBackgroundImage. Cette fonction est censé supporté plusieurs formats dont jpg et png. Cependant, l'utilisation de cette fonction :
- m'affiche un fond aléatoire (noir,bleu,...) avec le format png
- me crée une erreur avec le format jpg.
J'affiche le code d'un graphe très simple qui me sert à tester la fonction SetBackgroundImage :
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
<?php
 
include ("connexion.php");
include ("../../jpgraph-1.7/src/jpgraph.php");
include ("../../jpgraph-1.7/src/jpgraph_bar.php");
 
$x=array(1,2,3,4);
 
$graph = new Graph(750,500);
 
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME); 
 
$graph->SetScale("textlin");
$graph->SetShadow();
 
$graph->title->Set("PPM Défauts bobine / TBL");
 
$b1plot = new BarPlot($x);
$b1plot->SetFillColor("red");
 
$graph->Add($b1plot);
 
$graph->Stroke();
?>
Si des utilisateurs de jpgraph pouvait me porter secours, je leur serais reconnaissant
Merci d'avance