Skip to content

Task Bars

Use gantt.visuals to customize task bars. The example uses a different color for Backend setup and adds markers to tasks with a deadline.

grid.gantt = {
...project,
visuals: {
showTaskLabels: 'tasks',
taskLabelPlacement: 'auto',
taskBarColorHook: ({ row }) =>
row.id === 'backend' ? { barColor: '#64748b' } : undefined,
taskMarkerHook: (task) =>
task.deadlineDate
? [
{
id: `deadline-${task.id}`,
date: task.deadlineDate,
label: 'Deadline',
},
]
: [],
},
};
  • Set showTaskLabels to 'tasks' for task and milestone labels, 'all' to include summaries, or false to hide labels. Set taskLabelPlacement to 'inside', 'outside', or 'auto' for regular tasks.
  • Use taskBarContent to customize label content while retaining the built-in progress, resize, and dependency controls. The legacy taskBarContentHook takes precedence when both are supplied.
  • Set visuals.showInteractionShadow to false to hide the snapped destination shadow during task moves and resizes. It is visible by default.
  • Use Task Tooltips to configure the detail shown on hover and Actuals and Progress to configure the task-table progress display.