gpor/gantt

Simple Gantt chart

dev-master 2018-04-06 04:22 UTC

This package is not auto-updated.

Last update: 2025-05-04 00:19:03 UTC


README

Simple Gantt chart

instantiate

$groupedCols = \Gpor\Gantt\DatesHelper::ganttColGroups(
    ($_GET['start'] ?? time()),
    ($_GET['end'] ?? null)
);
$gantt = \Gpor\Gantt\Factory::newGantt($groupedCols, $rows, ['isMobile' => $agent->isMobile()]);

Config

# custom bar text
$gantt->barTextFunction = function(\Gpor\Gantt\Bar $bar) {
    return date('j M Y', strtotime($bar->start_date)) . ' - ' . date('j M Y', strtotime($bar->end_date));
};

# disable bar text
$gantt->barTitleAttrs = false;
$gantt->barTextShow = false;

if you disable barTitleAttrs, the bar will have a data-text atrribute instead