本文整理匯總了PHP中GanttBar::setFillColor方法的典型用法代碼示例。如果您正苦於以下問題:PHP GanttBar::setFillColor方法的具體用法?PHP GanttBar::setFillColor怎麽用?PHP GanttBar::setFillColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GanttBar
的用法示例。
在下文中一共展示了GanttBar::setFillColor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: executeGanttChart
/**
* Executes ganttChart action
*
*/
public function executeGanttChart()
{
//@todo change color according to status, and add a legend
$this->forward404Unless($project = ProjectPeer::retrieveBySlug($this->getRequestParameter('project')));
$w = 450;
$graph = new sfJpGraph('gantt', 0, 0);
$graph = $graph->getJpGraph();
$graph->SetShadow();
// Add title and subtitle
$graph->title->Set($project->getTitle());
//$graph->title-> SetFont( FF_ARIAL, FS_BOLD,12);
$graph->subtitle->Set("(Gantt Chart)");
// Show day, week and month scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
// Instead of week number show the date for the first day in the week
// on the week scale
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Make the week scale font smaller than the default
$graph->scale->week->SetFont(FF_FONT0);
// Use the short name of the month together with a 2 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
// Use the short name of the month together with a 4 digit year
// on the month scale
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
//$graph->scale-> month-> SetTextColor( "white");
$graph->scale->month->SetBackgroundColor("blue");
$row = 0;
foreach ($project->getTasks() as $task) {
$activity = new GanttBar($row, $task->getName(), $task->getBegin('Y-m-d'), $task->getFinish('Y-m-d'));
$activity->SetPattern(BAND_RDIAG, "red");
$activity->setFillColor("blue");
// Finally add the bar to the graph
$graph->Add($activity);
$row++;
}
// ... and display it
$graph->Stroke();
}