当前位置: 首页>>代码示例>>PHP>>正文


PHP GanttBar类代码示例

本文整理汇总了PHP中GanttBar的典型用法代码示例。如果您正苦于以下问题:PHP GanttBar类的具体用法?PHP GanttBar怎么用?PHP GanttBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GanttBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getJPGraphBar

 public function getJPGraphBar($issueActivityMapping)
 {
     $user = UserCache::getInstance()->getUser($this->userid);
     $issue = IssueCache::getInstance()->getIssue($this->bugid);
     if (NULL != $issue->getTcId()) {
         $formatedActivityName = substr($this->bugid . " [" . $issue->getTcId() . "] - " . $issue->getSummary(), 0, 50);
     } else {
         $formatedActivityName = substr($this->bugid . " - " . $issue->getSummary(), 0, 50);
     }
     $formatedActivityInfo = $user->getName();
     if ($issue->getCurrentStatus() < $issue->getBugResolvedStatusThreshold()) {
         $formatedActivityInfo .= " (" . Constants::$statusNames[$issue->getCurrentStatus()] . ")";
     }
     $bar = new GanttBar($this->activityIdx, utf8_decode($formatedActivityName), date('Y-m-d', $this->startTimestamp), date('Y-m-d', $this->endTimestamp), $formatedActivityInfo, 10);
     // --- colors
     $bar->SetPattern(GANTT_SOLID, $this->color);
     $bar->progress->Set($this->progress);
     $bar->progress->SetPattern(GANTT_SOLID, 'slateblue');
     // --- add constrains
     $relationships = $issue->getRelationships();
     $relationships = $relationships['' . Constants::$relationship_constrains];
     if (is_array($relationships)) {
         foreach ($relationships as $bugid) {
             // Add a constrain from the end of this activity to the start of the activity $bugid
             $bar->SetConstrain($issueActivityMapping[$bugid], CONSTRAIN_ENDSTART);
         }
     }
     if (self::$logger->isDebugEnabled()) {
         self::$logger->debug("JPGraphBar bugid={$this->bugid} prj=" . $issue->getProjectId() . " activityIdx={$this->activityIdx}" . " progress={$this->progress} [" . date('Y-m-d', $this->startTimestamp) . " -> " . date('Y-m-d', $this->endTimestamp) . "]");
         self::$logger->debug("JPGraphBar bugid={$this->bugid} GanttBar = " . var_export($bar, TRUE));
     }
     return $bar;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:33,代码来源:gantt_manager.class.php

示例2: prj_drawProjectTasksGanttBar

function prj_drawProjectTasksGanttBar(&$graph, &$row, &$count, $pid = 0, $nameIndent = '', $tid = 0, $sampleCounting = 0, $sm, $stm)
{
    global $_TABLES, $_CONF, $showMonitor, $showTeamMember, $userid, $_PRJCONF, $filterCSV;
    $sql = 'SELECT tid,name,start_date, estimated_end_date,parent_task, progress, progress_id ';
    $sql .= "FROM {$_TABLES['prj_tasks']} ";
    if ($pid == 0) {
        $sql .= 'WHERE pid=0 ';
    } else {
        $sql .= "WHERE pid='{$pid}' ";
    }
    $sql .= "and parent_task={$tid} ";
    if ($filterCSV != '') {
        $sql .= "AND  {$_TABLES['prj_tasks']}.pid  in ({$filterCSV}) ";
    }
    $sql .= ' ORDER BY lhs ASC';
    $result = DB_query($sql, true);
    $testnumrows = DB_numRows($result);
    if ($testnumrows == 0) {
        //this is to help overcome any COOKIE issues with the filtercsv
        $sql = 'SELECT tid,name,start_date, estimated_end_date,parent_task, progress, progress_id ';
        $sql .= "FROM {$_TABLES['prj_tasks']} ";
        if ($pid == 0) {
            $sql .= 'WHERE pid=0 ';
        } else {
            $sql .= "WHERE pid='{$pid}' ";
        }
        $sql .= "and parent_task={$tid} ";
        $sql .= ' ORDER BY lhs ASC';
        $result = DB_query($sql);
    }
    for ($j = 0; $j < DB_numrows($result); $j++) {
        list($tid, $name, $startdate, $enddate, $parent_task, $progress, $status) = DB_fetchArray($result);
        $permsArray = prj_getProjectPermissions($pid, $userid, $tid);
        $ownertoken = getTaskToken($tid, $userid, "{$_TABLES['prj_task_users']}", "{$_TABLES['prj_tasks']}");
        if ($sm == '1' && $stm == '1') {
            // all projects
            if ($permsArray['monitor'] == '1' || $permsArray['teammember'] == '1' || $ownertoken != 0) {
                $name = html_entity_decode($name);
                $strdate = strftime("%Y/%m/%d", $startdate);
                $edate = strftime("%Y/%m/%d", $enddate);
                $sql = "SELECT c.fullname ";
                $sql .= "FROM {$_TABLES['prj_task_users']} a ";
                $sql .= "INNER JOIN {$_TABLES['prj_tasks']} b on a.tid=b.tid ";
                $sql .= "INNER JOIN {$_TABLES['users']} c on a.uid=c.uid ";
                $sql .= "WHERE a.role='o' AND a.tid={$tid} ";
                $result2 = DB_query($sql);
                list($owner) = DB_fetchArray($result2);
                $link = $_CONF['site_url'] . "/nexproject/viewproject.php?mode=view&id=" . $tid;
                $count = $count + 1;
                if (strlen($name) > $_PRJCONF['project_name_length']) {
                    $name = substr($name, 0, $_PRJCONF['project_name_length']);
                    $name .= "...";
                }
                $name = $nameIndent . $name;
                if ($strdate == $edate) {
                    $milestone = new Milestone($row, $name, $strdate);
                    $milestone->mark->SetType(MARK_DIAMOND);
                    $graph->Add($milestone);
                } else {
                    $taskActivity = new GanttBar($count, $name, "{$strdate}", "{$edate}", "");
                    if ($status == 0) {
                        // Yellow diagonal line pattern on a red background
                        $taskActivity->SetPattern(BAND_RDIAG, "green");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    } elseif ($status == 1) {
                        $taskActivity->SetPattern(BAND_RDIAG, "yellow");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    } else {
                        $taskActivity->SetPattern(BAND_RDIAG, "red");
                        $taskActivity->progress->SetPattern(GANTT_RDIAG, "black");
                        $taskActivity->progress->SetFillColor("white");
                    }
                    $taskActivity->caption->SetFont(FF_FONT1, FS_NORMAL, 10);
                    $taskActivity->caption->SetColor('black');
                    $taskActivity->caption->Set($name);
                    // Set absolute height
                    $taskActivity->SetHeight(10);
                    $taskActivity->progress->Set($progress / 100);
                    // Specify progress
                    $taskActivity->SetCSIMTarget("{$link}");
                    $taskActivity->SetCSIMAlt($progress . "% completed");
                    $tempval = $_GET['expanded'];
                    $tempval2 = $_SERVER['PHP_SELF'];
                    $taskActivity->title->SetCSIMTarget("");
                    $taskActivity->title->SetCSIMAlt($progress . "% completed");
                    $qconstraints = DB_query("SELECT tid FROM {$_TABLES['prj_tasks']} WHERE parent_task='{$tid}' ORDER BY lhs ASC");
                    $numconstraints = DB_numRows($qconstraints);
                    for ($c = 1; $c <= $numconstraints; $c++) {
                        //$taskActivity->SetConstrain($row+$c,CONSTRAIN_STARTSTART,"maroon4");
                    }
                    // Add line to Gantt Chart
                    if (!$sampleCounting) {
                        $graph->Add($taskActivity);
                    }
                }
                $row++;
            }
        } else {
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:projects_gantt.php

示例3: foreach

                    $bar2->title->SetFont(FF_CUSTOM, FS_NORMAL, 9);
                    $bar2->title->SetColor('#CC0000');
                    $graph->Add($bar2);
                }
                //Insert workers for each task into Gantt Chart
                $q->addTable('user_tasks', 't');
                $q->addQuery('DISTINCT user_username, t.task_id');
                $q->addJoin('users', 'u', 'u.user_id = t.user_id');
                $q->addWhere('t.task_id = ' . $t['task_id']);
                $q->addOrder('user_username ASC');
                $workers = $q->loadList();
                $q->clear();
                $workersName = '';
                foreach ($workers as $w) {
                    $workersName .= ' ' . $w['user_username'];
                    $bar3 = new GanttBar($row++, array('   * ' . $w['user_username'], ' ', ' ', ' '), $tStartObj->format(FMT_DATETIME_MYSQL), $tEndObj->format(FMT_DATETIME_MYSQL), 0.6);
                    $bar3->title->SetFont(FF_CUSTOM, FS_NORMAL, 9);
                    $bar3->title->SetColor(bestColor('#ffffff', '#' . $p['project_color_identifier'], '#000000'));
                    $bar3->SetFillColor('#' . $p['project_color_identifier']);
                    $graph->Add($bar3);
                }
                //End of insert workers for each task into Gantt Chart
            }
            unset($tasks);
            //End of insert tasks into Gantt Chart
        }
        //End of if showAllGant checkbox is checked
    }
}
// End of check for valid projects array.
unset($projects);
开发者ID:kilivan,项目名称:dotproject,代码行数:31,代码来源:gantt.php

示例4: CDate

     $q->addWhere('t.task_duration_type = 1');
     $q->addWhere('t.task_id = ' . (int) $a['task_id']);
     $wh2 = $q->loadResult();
     $work_hours += $wh2;
     $q->clear();
     //due to the round above, we don't want to print decimals unless they really exist
     $dur = $work_hours;
 }
 $dur .= ' h';
 $enddate = new CDate($end);
 $startdate = new CDate($start);
 //$gantt->addBar($name, $start, $end, $actual_end, $caption, 0.6, $p['project_color_identifier'], $p['project_active'], $progress);
 if ($caller == 'todo') {
     $bar = new GanttBar($row++, array($name, $pname, $dur, $startdate->format($df), $enddate->format($df)), substr($start, 2, 8), substr($end, 2, 8), $cap, $a['task_dynamic'] == 1 ? 0.1 : 0.6);
 } else {
     $bar = new GanttBar($row++, array($name, $dur, $startdate->format($df), $enddate->format($df)), substr($start, 2, 8), substr($end, 2, 8), $cap, $a['task_dynamic'] == 1 ? 0.1 : 0.6);
 }
 $bar->progress->Set(min($progress / 100, 1));
 if (is_file(TTF_DIR . 'FreeSans.ttf')) {
     $bar->title->SetFont(FF_CUSTOM, FS_NORMAL, 8);
 }
 if ($a['task_dynamic'] == 1) {
     if (is_file(TTF_DIR . 'FreeSans.ttf')) {
         $bar->title->SetFont(FF_CUSTOM, FS_BOLD, 8);
     }
     $bar->rightMark->Show();
     $bar->rightMark->SetType(MARK_RIGHTTRIANGLE);
     $bar->rightMark->SetWidth(3);
     $bar->rightMark->SetColor('black');
     $bar->rightMark->SetFillColor('black');
     $bar->leftMark->Show();
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:gantt.php

示例5: CreateSimple

 function CreateSimple($data, $constrains = array(), $progress = array())
 {
     $num = count($data);
     for ($i = 0; $i < $num; ++$i) {
         switch ($data[$i][1]) {
             case ACTYPE_GROUP:
                 // Create a slightly smaller height bar since the
                 // "wings" at the end will make it look taller
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 8);
                 $a->title->SetFont($this->iSimpleFont, FS_BOLD, $this->iSimpleFontSize);
                 $a->rightMark->Show();
                 $a->rightMark->SetType(MARK_RIGHTTRIANGLE);
                 $a->rightMark->SetWidth(8);
                 $a->rightMark->SetColor('black');
                 $a->rightMark->SetFillColor('black');
                 $a->leftMark->Show();
                 $a->leftMark->SetType(MARK_LEFTTRIANGLE);
                 $a->leftMark->SetWidth(8);
                 $a->leftMark->SetColor('black');
                 $a->leftMark->SetFillColor('black');
                 $a->SetPattern(BAND_SOLID, 'black');
                 $csimpos = 6;
                 break;
             case ACTYPE_NORMAL:
                 $a = new GanttBar($data[$i][0], $data[$i][2], $data[$i][3], $data[$i][4], '', 10);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->SetPattern($this->iSimpleStyle, $this->iSimpleColor);
                 $a->SetFillColor($this->iSimpleBkgColor);
                 // Check if this activity should have a constrain line
                 $n = count($constrains);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($constrains[$j]) || count($constrains[$j]) != 3) {
                         JpGraphError::RaiseL(6003, $j);
                         //("Invalid format for Constrain parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Constrain-To,Constrain-Type)");
                     }
                     if ($constrains[$j][0] == $data[$i][0]) {
                         $a->SetConstrain($constrains[$j][1], $constrains[$j][2], 'black', ARROW_S2, ARROWT_SOLID);
                     }
                 }
                 // Check if this activity have a progress bar
                 $n = count($progress);
                 for ($j = 0; $j < $n; ++$j) {
                     if (empty($progress[$j]) || count($progress[$j]) != 2) {
                         JpGraphError::RaiseL(6004, $j);
                         //("Invalid format for Progress parameter at index=$j in CreateSimple(). Parameter must start with index 0 and contain arrays of (Row,Progress)");
                     }
                     if ($progress[$j][0] == $data[$i][0]) {
                         $a->progress->Set($progress[$j][1]);
                         $a->progress->SetPattern($this->iSimpleProgressStyle, $this->iSimpleProgressColor);
                         $a->progress->SetFillColor($this->iSimpleProgressBkgColor);
                         //$a->progress->SetPattern($progress[$j][2],$progress[$j][3]);
                         break;
                     }
                 }
                 $csimpos = 6;
                 break;
             case ACTYPE_MILESTONE:
                 $a = new MileStone($data[$i][0], $data[$i][2], $data[$i][3]);
                 $a->title->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $a->caption->SetFont($this->iSimpleFont, FS_NORMAL, $this->iSimpleFontSize);
                 $csimpos = 5;
                 break;
             default:
                 die('Unknown activity type');
                 break;
         }
         // Setup caption
         $a->caption->Set($data[$i][$csimpos - 1]);
         // Check if this activity should have a CSIM target�?
         if (!empty($data[$i][$csimpos])) {
             $a->SetCSIMTarget($data[$i][$csimpos]);
             $a->SetCSIMAlt($data[$i][$csimpos + 1]);
         }
         if (!empty($data[$i][$csimpos + 2])) {
             $a->title->SetCSIMTarget($data[$i][$csimpos + 2]);
             $a->title->SetCSIMAlt($data[$i][$csimpos + 3]);
         }
         $this->Add($a);
     }
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:80,代码来源:jpgraph_gantt.php

示例6: GanttBar

<?php

// Gantt example to create CSIM
include "../jpgraph.php";
include "../jpgraph_gantt.php";
$bar1 = new GanttBar(0, "Activity 1", "2001-12-21", "2002-01-20");
$bar1->SetCSIMTarget('#', 'Go back 1');
$bar1->title->SetCSIMTarget('#', 'Go back 1 (title)');
$bar2 = new GanttBar(1, "Activity 2", "2002-01-03", "2002-01-25");
$bar2->SetCSIMTarget('#', 'Go back 2');
$bar2->title->SetCSIMTarget('#', 'Go back 2 (title)');
$graph = new GanttGraph(500);
$graph->title->Set("Example with image map");
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT1);
$graph->Add(array($bar1, $bar2));
// And stroke
$graph->StrokeCSIM();
?>


开发者ID:JackPotte,项目名称:xtools,代码行数:20,代码来源:ganttcsimex01.php

示例7: GanttBar

     $bar = new GanttBar($row++, $bar_label_array, $start, $end, $cap, $a['task_dynamic'] == 1 ? 0.1 : 0.6);
     $bar->progress->Set(min($progress / 100, 1));
     // make the font a little bigger if showing task names only
     if ($monospacefont) {
         $bar->title->SetFont(FF_DEJAVUMONO, FS_NORMAL, 10);
         //specify the use of VeraMono
     } else {
         $bar->title->SetFont(FF_DEJAVU, FS_NORMAL, 10);
     }
 } else {
     if ($caller == 'todo') {
         $bar_label_array = array($name, $pname, $dur, $startdate->format($df), $enddate->format($df));
     } else {
         $bar_label_array = array($name, $dur, $startdate->format($df), $enddate->format($df));
     }
     $bar = new GanttBar($row++, $bar_label_array, $start, $end, $cap, $a['task_dynamic'] == 1 ? 0.1 : 0.6);
     $bar->progress->Set(min($progress / 100, 1));
     if ($monospacefont) {
         $bar->title->SetFont(FF_DEJAVUMONO, FS_NORMAL, 8);
         //specify the use of VeraMono
     } else {
         $bar->title->SetFont(FF_DEJAVU, FS_NORMAL, 8);
     }
 }
 // make the font a little bigger if showing task names only////////////////////////////////
 if ($a['task_dynamic'] == 1) {
     if ($showTaskNameOnly == '1') {
         if ($monospacefont) {
             $bar->title->SetFont(FF_DEJAVUMONO, FS_BOLD, 10);
             //specify the use of VeraMono
         } else {
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:gantt.php

示例8: getGanttGraph

 /**
  * @param int $teamid
  * @param int $startTimestamp
  * @param int $endTimestamp
  * @param int[] $projectIds
  * @return GanttGraph
  */
 private function getGanttGraph($teamid, $startTimestamp, $endTimestamp, array $projectIds)
 {
     $graph = new GanttGraph();
     // set graph title
     $team = TeamCache::getInstance()->getTeam($teamid);
     if (0 != count($projectIds)) {
         $pnameList = "";
         foreach ($projectIds as $pid) {
             if ("" != $pnameList) {
                 $pnameList .= ",";
             }
             $project = ProjectCache::getInstance()->getProject($pid);
             $pnameList .= $project->getName();
         }
         $graph->title->Set(T_('Team') . ' ' . $team->getName() . '    ' . T_('Project(s)') . ': ' . $pnameList);
     } else {
         $graph->title->Set(T_('Team') . ' ' . $team->getName() . '    (' . T_('All projects') . ')');
     }
     // Setup scale
     $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
     $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
     $gantManager = new GanttManager($teamid, $startTimestamp, $endTimestamp);
     $teamActivities = $gantManager->getTeamActivities();
     // mapping to ease constrains building
     // Note: $issueActivityMapping must be completed before calling $a->getJPGraphBar()
     $issueActivityMapping = array();
     $activityIdx = 0;
     foreach ($teamActivities as $a) {
         $a->setActivityIdx($activityIdx);
         $issueActivityMapping[$a->bugid] = $activityIdx;
         ++$activityIdx;
     }
     // Add the specified activities
     foreach ($teamActivities as $a) {
         // FILTER on projects
         if (NULL != $projectIds && 0 != sizeof($projectIds)) {
             $issue = IssueCache::getInstance()->getIssue($a->bugid);
             if (!in_array($issue->getProjectId(), $projectIds)) {
                 // skip activity indexing
                 continue;
             }
         }
         $filterTeamActivities[] = $a;
         // Shorten bar depending on gantt startDate
         if (NULL != $startTimestamp && $a->startTimestamp < $startTimestamp) {
             // leave one day to insert prefixBar
             $newStartTimestamp = $startTimestamp + 60 * 60 * 24;
             if ($newStartTimestamp > $a->endTimestamp) {
                 // there is not enough space for a prefixBar
                 $newStartTimestamp = $startTimestamp;
                 self::$logger->debug("bugid=" . $a->bugid . ": Shorten bar to Gantt start date");
             } else {
                 $formattedStartDate = date('Y-m-d', $startTimestamp);
                 $prefixBar = new GanttBar($a->activityIdx, "", $formattedStartDate, $formattedStartDate, "", 10);
                 $prefixBar->SetBreakStyle(true, 'dotted', 1);
                 $graph->Add($prefixBar);
                 self::$logger->debug("bugid=" . $a->bugid . ": Shorten bar & add prefixBar");
             }
             self::$logger->debug("bugid=" . $a->bugid . ": Shorten bar from " . date('Y-m-d', $a->startTimestamp) . " to " . date('Y-m-d', $newStartTimestamp));
             $a->startTimestamp = $newStartTimestamp;
         }
         $bar = $a->getJPGraphBar($issueActivityMapping);
         $graph->Add($bar);
     }
     return $graph;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:73,代码来源:gantt_graph.php

示例9: grafica

function grafica($fecha_max, $fecha_min, $datos)
{
    $graph = new GanttGraph();
    $graph->title->Set("");
    // Rango de fechas a presentar
    $graph->SetDateRange($fecha_min, $fecha_max);
    // linea de espaciado vertical entre los elementos
    $graph->SetVMarginFactor(2);
    // configuracion de colores
    $graph->SetMarginColor('lightgreen@0.8');
    //  color del fondo
    $graph->SetBox(true, 'yellow:0.6', 2);
    //  contorno del marco interior
    $graph->SetFrame(true, 'darkgreen', 4);
    // contorno  del marco exterior
    $graph->scale->divider->SetColor('yellow:0.6');
    // linea divisora de datos y grafico
    $graph->scale->dividerh->SetColor('red:0.6');
    //liena que divide el tiempo con las barras de la grafica
    // Ponemos la medida de tiempo que queremos usar, por ejemplo años, meses, dias, hors o minutos
    //por ejemplo, si queremos solamente la division por meses y semanas en lugar de tener
    //GANTT_HWEEK | GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY
    //dejamos
    //GANTT_HWEEK | GANTT_HMONTH
    // para mas opciones de division de tiempo ver comentarios abajo
    $graph->ShowHeaders(GANTT_HWEEK | GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY);
    $graph->scale->month->grid->SetColor('gray');
    //lineas verticales que dividen los meses
    $graph->scale->month->grid->Show(true);
    $graph->scale->year->grid->SetColor('gray');
    // linea verticales que dividen los años
    $graph->scale->year->grid->Show(true);
    $graph->scale->actinfo->SetColTitles(array('Acción', 'Duracion', 'Inicio', 'Final', 'Porcentaje'), array(30, 100));
    $graph->scale->actinfo->SetBackgroundColor('blue:0.5@0.5');
    //color de fondo de los titulos de la tabla
    $graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 12);
    //tipografia
    // division vertical de los datos a la izquierda, posibles valores 'solid', 'dotted', 'dashed'
    $graph->scale->actinfo->vgrid->SetStyle('solid');
    $graph->scale->actinfo->vgrid->SetColor('red');
    // color de las divisiones puestas en el renglon anterior
    // Configuración de los iconos que queremos usar
    //para poner algun icono no definido podemos usarlo de la siguiente manera
    //$icon = new IconImage("imagen.png",0.7);
    //en el ejemplo estoy usando una omagen desde blogspot
    //el numero que es el segundo parametro de IconImage es el porcentaje de la imagen, en este caso esta al 20%
    $erricon = new IconImage("logo-copia.png", 0.2);
    $startconicon = new IconImage(GICON_FOLDEROPEN, 0.6);
    $endconicon = new IconImage(GICON_TEXTIMPORTANT, 0.5);
    //ahora ponemos los datos de la tabla e iniciamos los datos de las barras
    //    $data = array(
    //        //valores del arreglo:
    //        //indice del arreglo, arreglo de datos para la informacion a la izquierda, fecha de inicio de la barra, fecha final de la barra, tipografia, estilo,tamaño tipografia,% de progreso en la barra
    //        array(0,array("Pre-study","17 days","1 Nov '2011","1 Mar '2012")
    //              , "2011-11-01","2012-01-1",FF_ARIAL,FS_NORMAL,8, 0.5),//el 0.5 indica el 50%, que ocuparemos en la linea 74, dando su posicion en el arreglo
    //        array(1,array("Prototype","10 days","26 Oct '2011","16 Nov '2011"),
    //              "2011-10-26","2011-11-01",FF_ARIAL,FS_NORMAL,8, 0.12),
    //        array(2,array("Report","12 days","1 Mar '2012","13 Mar '2012"),
    //              "2012-03-01","2012-03-13",FF_ARIAL,FS_NORMAL,8, 1)
    //    );
    $data = $datos;
    // Crea las barras y las añade a la grafica gantt
    for ($i = 0; $i < count($data); ++$i) {
        $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '', 10);
        if (count($data[$i]) > 4) {
            $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]);
        }
        $bar->SetPattern(BAND_RDIAG, "yellow");
        $bar->SetFillColor("gray");
        $bar->progress->Set($data[$i][7]);
        // ocupamos el % de adelanto en la actividad
        $bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
        //$bar->title->SetCSIMTarget(array('#1'.$i,'#2'.$i,'#3'.$i,'#4'.$i,'#5'.$i),array('11'.$i,'22'.$i,'33'.$i));
        $graph->Add($bar);
        //echo "<br>--> ".$data[$i][7];
    }
    // Creamos la imagen y le damos nombre, la imagen se guarda donde estan estos archivos
    $graph->Stroke('imagenprueba.jpg');
}
开发者ID:giovanny751,项目名称:sst,代码行数:79,代码来源:grafica.php

示例10: GanttGraph

<?php

// Gantt example
include "../jpgraph.php";
include "../jpgraph_gantt.php";
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Example with multiple constrains");
$bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12");
$bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19");
$bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21");
//create constraints
$bar1->SetConstrain(1, CONSTRAIN_ENDSTART);
$bar1->SetConstrain(2, CONSTRAIN_ENDSTART);
// Setup scale
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
// Add the specified activities
$graph->Add($bar1);
$graph->Add($bar2);
$graph->Add($bar3);
// .. and stroke the graph
$graph->Stroke();
开发者ID:Ethennoob,项目名称:Web,代码行数:23,代码来源:multconstganttex01.php

示例11: GanttBar

// match the weekend settings ...
$graph->scale->hour->SetFontColor($styles->val('image.session.header.color', 'black', true));
$graph->scale->hour->SetBackgroundColor($styles->val('image.session.header.bgcolor', 'lightyellow:1.5', true));
$graph->scale->hour->SetFont(constant($styles->val('image.session.font', 'FF_FONT0', true)));
$graph->scale->hour->SetIntervall($styles->val('image.session.interval', 2, true));
$graph->scale->hour->SetStyle(constant($styles->val('image.session.header.hourstyle', 'HOURSTYLE_H24', true)));
/**
$graph->scale->actinfo->SetBackgroundColor('lightyellow:1.5');
$graph->scale->actinfo->SetFont(FF_FONT0);
$graph->scale->actinfo->SetColTitles(array(""));
/**/
$show = (bool) $styles->val('image.session.hgrid.show', true, true);
$graph->hgrid->Show($show);
if ($show) {
    $graph->hgrid->SetRowFillColor($styles->val('image.session.hgrid.color1', 'whitesmoke@0.9', true), $styles->val('image.session.hgrid.color2', 'darkblue@0.9', true));
}
for ($i = 0; $i < count($data); ++$i) {
    $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3]);
    $bar->SetPattern(constant($styles->val('image.session.bar.pattern', 'BAND_RDIAG', true)), $styles->val('image.session.bar.patternfill', 'lightblue', true));
    $bar->SetFillColor($styles->val('image.session.bar.fill', 'BAND_SOLID', true));
    $shadow = $styles->val('image.session.bar.shadow', '', true);
    if ($shadow) {
        $bar->SetShadow(true, $shadow);
    }
    $graph->Add($bar);
}
$graph->SetVMarginFactor($styles->val('image.session.bar.vmargin', 0.4, true));
if ($styles->val('image.session.showfooter', 'image.common.footer.show')) {
    stdImgFooter($graph);
}
$graph->Stroke();
开发者ID:Nerus87,项目名称:PsychoStats,代码行数:31,代码来源:imgsess.php

示例12: graficar

 public function graficar($filename)
 {
     $graph = new GanttGraph();
     $graph->SetShadow();
     $graph->SetBox();
     // Only show part of the Gantt
     $graph = new GanttGraph(1000);
     /*
     $graph->title->Set('Proceso '.$this->dataSource->getParameter('desc_proceso_macro')."\n".
     																			'Seguimiento de Solicitud '.$this->dataSource->getParameter('numero')."\n".
     																			'Unidad '.$this->dataSource->getParameter('desc_uo'));
     $graph->title->SetFont(FF_ARIAL,FS_BOLD,6);
     */
     define('UTF-8', $locale_char_set);
     // Setup some "very" nonstandard colors
     $graph->SetMarginColor('lightgreen@0.8');
     $graph->SetBox(true, 'yellow:0.6', 2);
     $graph->SetFrame(true, 'darkgreen', 4);
     $graph->scale->divider->SetColor('yellow:0.6');
     $graph->scale->dividerh->SetColor('yellow:0.6');
     // Explicitely set the date range
     // (Autoscaling will of course also work)
     // Display month and year scale with the gridlines
     $graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY);
     $graph->scale->month->grid->SetColor('gray');
     $graph->scale->month->grid->Show(true);
     $graph->scale->year->grid->SetColor('gray');
     $graph->scale->year->grid->Show(true);
     // Setup a horizontal grid
     $graph->hgrid->Show();
     $graph->hgrid->SetRowFillColor('darkblue@0.9');
     // Setup activity info
     // For the titles we also add a minimum width of 100 pixels for the Task name column
     $graph->scale->actinfo->SetColTitles(array('Tipo', 'Estado', 'Responsable', 'Duracion', 'Inicio', 'Fin'), array(40, 100));
     $graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5');
     $graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 10);
     $data = array();
     $dataset = $this->dataSource->getDataset();
     $tamanioDataset = count($dataset);
     $fechaInicio = 0;
     $fechaFin = 0;
     for ($i = 0; $i < $tamanioDataset; $i++) {
         if ($i == 0) {
             $fechaInicio = $dataset[$i]['fecha_reg'];
         }
         /*
         if($dataset[$i]['nombre_estado']=='En_Proceso'||$dataset[$i]['nombre_estado']=='Habilitado para pagar'||$dataset[$i]['nombre_estado']=='En Pago'){
         		$milestone = new MileStone($i,$dataset[$i]['nombre_estado'],$dataset[$i]['fecha_reg'],$dataset[$i]['fecha_reg']);
         		$milestone->title->SetColor("black");
         		$milestone->title->SetFont(FF_FONT1,FS_BOLD);
         		$graph->Add($milestone);
         		continue;
         }
         */
         $actividad = array();
         array_push($actividad, $i);
         if ($i == $tamanioDataset - 1) {
             $fechaFin = $dataset[$i]['fecha_reg'];
         } else {
             $fechaFin = $dataset[$i + 1]['fecha_reg'];
         }
         $startLiteral = new DateTime($dataset[$i]['fecha_reg']);
         $endLiteral = new DateTime($fechaFin);
         $start = strtotime($dataset[$i]['fecha_reg']);
         $end = strtotime($fechaFin);
         $days_between = round(($end - $start) / 86400);
         $cabecera = array($dataset[$i]['proceso'], $dataset[$i]['estado'], $dataset[$i]['funcionario'] != '-' ? $dataset[$i]['func'] : $dataset[$i]['depto'], "{$days_between}" . ' dias', $startLiteral->format('d M Y'), $endLiteral->format('d M Y'));
         array_push($actividad, $cabecera);
         array_push($actividad, $dataset[$i]['fecha_reg']);
         array_push($actividad, $fechaFin);
         array_push($actividad, FF_ARIAL);
         array_push($actividad, FS_NORMAL);
         array_push($actividad, 8);
         array_push($data, $actividad);
     }
     // Create the bars and add them to the gantt chart
     for ($i = 0; $i < count($data); $i++) {
         $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[100%]", 10);
         if (count($data[$i]) > 4) {
             $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]);
         }
         $bar->SetPattern(BAND_RDIAG, "yellow");
         $bar->SetFillColor("gray");
         $bar->progress->Set(1);
         $bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
         $graph->Add($bar);
     }
     //$graph->SetDateRange($fechaInicio,$fechaFin);
     $archivo = dirname(__FILE__) . '/../../../reportes_generados/' . $filename;
     //$graph->StrokeCSIM();
     //exit;
     $graph->Stroke($archivo);
 }
开发者ID:hcvcastro,项目名称:pxp,代码行数:93,代码来源:DiagramadorGanttTramite.php

示例13: array

     if ($equipment_reservations[$id]) {
         //put the information in a new array
         $gantt_data[$id] = $equipment_reservations[$id]['reservations'];
     } else {
         $gantt_data[$id][] = array('reservation_idx' => NULL, 'start_date' => '0000-00-00', 'end_date' => '0000-00-00');
     }
 }
 if ($gantt_data) {
     foreach ($gantt_data as $id => $item) {
         foreach ($item as $reservation) {
             if ($id != $current_id) {
                 //this makes it so that it will only add the item on the same line if it has multiple dates
                 $counter++;
                 $current_id = $id;
             }
             $activity = new GanttBar($counter, $id, $reservation['start_date'], $reservation['end_date']);
             $activity->SetCSIMTarget($GLOBALS['BASE_URL'] . '/admin/reservation/search/id/' . $reservation['reservation_idx'], "Reservation ID: " . $reservation['reservation_idx']);
             $graph->Add($activity);
         }
     }
 }
 //DRAW GRAPH
 $is_rendering_image = (bool) $_GET['_jpg_csimd'];
 // if jpgraph isn't rendering the image, it is instead rendering the image map.
 // turn on outputbuffering to capture the html
 if (!$is_rendering_image) {
     ob_start();
 }
 //end if
 // generate the graph (this dumps either the HTML OR the image contents)
 $graph->StrokeCSIM();
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:31,代码来源:admin.php

示例14: makeGroup

 /**
  * @param $task Task
  * @param $start_date string
  * @param $end_date string
  * @param $position
  * @return GanttBar
  *
  * Create a Gantt bar that represents a task with subtasks, this gives it 'wings' at each end to 
  * represent it spanning the subtasks.
  * $start_date and $end_date should be YYYY-MM-DD formatted dates
  */
 private function makeGroup(Task $task, $start_date, $end_date, $position)
 {
     $bar = new GanttBar($position, $task->name, $start_date, $end_date, $task->getField('duration')->formatted, 8);
     $bar->rightMark->Show();
     $bar->rightMark->SetType(MARK_RIGHTTRIANGLE);
     $bar->rightMark->SetWidth(8);
     $bar->rightMark->SetColor('#0077BD');
     $bar->rightMark->SetFillColor('#0077BD');
     $bar->leftMark->Show();
     $bar->leftMark->SetType(MARK_LEFTTRIANGLE);
     $bar->leftMark->SetWidth(8);
     $bar->leftMark->SetColor('#0077BD');
     $bar->leftMark->SetFillColor('#0077BD');
     $bar->setColor('#0077BD');
     $bar->SetPattern(BAND_SOLID, '#0077BD');
     return $bar;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:28,代码来源:EGSGantt.php

示例15: addSubSubBar

 public function addSubSubBar($label, $start, $end, $caption = '', $height = '0.6', $barcolor = 'FFFFFF', $progress = 0)
 {
     $startDate = new CDate($start);
     $endDate = new CDate($end);
     $bar = new GanttBar($this->rowCount++, array($label, ' ', ' ', ' '), $startDate->format(FMT_DATETIME_MYSQL), $endDate->format(FMT_DATETIME_MYSQL), 0.6);
     $bar->title->SetFont(FF_CUSTOM, FS_NORMAL, 9);
     $bar->SetFillColor('#' . $barcolor);
     $this->graph->Add($bar);
 }
开发者ID:joly,项目名称:web2project,代码行数:9,代码来源:ganttrenderer.class.php


注:本文中的GanttBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。