gpor / gantt
dev-master
2018-04-06 04:22 UTC
This package is not auto-updated.
Last update: 2024-09-21 21:11:49 UTC
README
简单的甘特图
实例化
$groupedCols = \Gpor\Gantt\DatesHelper::ganttColGroups( ($_GET['start'] ?? time()), ($_GET['end'] ?? null) ); $gantt = \Gpor\Gantt\Factory::newGantt($groupedCols, $rows, ['isMobile' => $agent->isMobile()]);
配置
# 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;
如果你禁用了barTitleAttrs,则条形将具有data-text属性