dcodegroup / gantt
Gantt Chart
Installs: 5 791
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
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