當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GanttBar::setFillColor方法代碼示例

本文整理匯總了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();
 }
開發者ID:sgrove,項目名稱:cothinker,代碼行數:43,代碼來源:actions.class.php


注:本文中的GanttBar::setFillColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。