Skip to content

Effort Modes

Source code
import { GANTT_RESOURCE_PLANNING_DEMO } from './gantt-advanced-data';
import { loadAdvancedGanttDemo } from './GanttAdvancedVanillaDemo';
export function load(parentSelector: string) {
return loadAdvancedGanttDemo(parentSelector, GANTT_RESOURCE_PLANNING_DEMO);
}

Use effortMode to model Microsoft Project-style task types:

ModeBehavior
fixed-durationPreserve duration. Work and units do not recalculate duration.
fixed-workPreserve workHours and derive duration from assigned units and calendar.
fixed-unitsPreserve assignment units and derive duration from workHours and units.

workHours is always stored as canonical hours. Set workUnit to retain a task-specific display unit, or enter Work as text such as 5h, 2d, or 3w. Project durationSettings.defaultWorkUnit can fix the default Work unit independently from Duration.

The duration formula for fixed-work/fixed-units is:

duration = ceil(workHours / (hoursPerDay * totalAssignmentUnits))
grid.source = [
{
id: 'standup',
name: 'Standup',
effortMode: 'fixed-duration',
duration: 1,
workHours: 2,
},
{
id: 'implementation',
name: 'Implementation',
effortMode: 'fixed-work',
workHours: 32,
workUnit: 'hour',
},
];
grid.ganttAssignments = [
{
taskId: 'implementation',
resourceId: 'alex',
allocationUnits: 100,
},
];

Expected result: standup keeps its one-day duration. implementation becomes four days (32h / 8h/day) with one 100% assignment.

See the Progress and work demo for more examples.