コード例 #1
0
ファイル: ganttex14.php プロジェクト: Ethennoob/Web
$graph = new GanttGraph(0, 0, "auto");
$graph->SetBox();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set("Example of captions");
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 12);
$graph->subtitle->Set("(ganttex14.php)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
$graph->scale->month->SetFontColor("white");
$graph->scale->month->SetBackgroundColor("blue");
// 0 % vertical label margin
$graph->SetLabelVMarginFactor(1);
// Format the bar for the first activity
// ($row,$title,$startdate,$enddate)
$activity = new GanttBar(0, "Project", "2001-12-21", "2002-01-07", "[50%]");
// Yellow diagonal line pattern on a red background
$activity->SetPattern(BAND_RDIAG, "yellow");
$activity->SetFillColor("red");
// Set absolute height
$activity->SetHeight(10);
// Specify progress to 60%
$activity->progress->Set(0.6);
// Format the bar for the second activity
// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1, "Project", "2001-12-21", "2002-01-02", "[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG, "yellow");