Réponse acceptée !
Voici une idée de solution :
<?php
// Gantt example
include
("../jpgraph.php");
include
("../jpgraph_gantt.php");
/*
N'oublies pas de récupérer ici tes données dans $tabTasksGantt
*/
//
// The data for the graphs
//
$data=array();
$j=1
// à modifier en fonction de requetes vers la base de données
$debut_projet="2006-10-26";
// à modifier en fonction de requetes vers la base de données
$fin_projet="2006-11-24";
$data[0]=array(0,ACTYPE_GROUP, "Mon projet", $debut_projet,$fin_projet,''),
foreach ($tabTasksGantt as $i=>$contenu)
{
$data[$j]=array($j,ACTYPE_NORMAL,$contenu,$tabTasksGantt[$i]['tasks_title'],$tabTasksGantt[$i]['beginning_date'],$tabTasksGantt[$i]['deadline'],'commentaire');
$j++;
}
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Gantt Graph using CreateSimple()");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Add the specified activities
$graph->SetSimpleStyle(GANTT_SOLID,'blue@0.7','blue@0.7');
$graph->CreateSimple($data);
// .. and stroke the graph
$graph->Stroke();
?>