j'ai un problème qui commence à me ...
J'utilise la librairie JPGraph afin de tracer l'evolution de points des utilisateurs de mon application.
Le pb est qu'il ne me prend pas les premières valeures de mes tableaux.
Dans le code d'origine :
Code : Tout sélectionner
$p1 = new LinePlot($datay1);
$p1->SetColor("navy");
$p1->SetLegend('Line 1');
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$p2->SetColor("red");
$p2->SetLegend('Line 2');
$graph->Add($p2);
Mon but était de rendre dynamique tout ça en faisant :
Code : Tout sélectionner
foreach($pts_par_user as $surnom => $rangs)
{
// Create the lines
$p[$surnom] = new LinePlot($rangs);
$p[$surnom]->SetColor($colors[$i]);
$p[$surnom]->SetLegend($surnom);
$graph->Add($p[$surnom]);
$i++;
}Code : Tout sélectionner
[DO] => Array
(
[1] => 1
[2] => 1
[3] => 1
[4] => 2
[5] => 3
[6] => 3
)
Le probleme est le suivant :
pour un tableau $rangs array(7,6,7,4,4,8) le graphe commence à 6 ?!
Merci pour votre aide