dcodegroup/gantt

Gantt Chart

v1.0.6 2018-04-16 00:13 UTC

This package is auto-updated.

Last update: 2024-04-14 03:33:27 UTC


README

Gantt chart

composer.json

    "autoload": {
        ...
        "psr-4": {
            ...,
            "DcodeGroup\\": "vendor/dcodegroup/"
        }
    },

instantiate

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

Config

# custom bar text
$gantt->barTextFunction = function(\DcodeGroup\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