Skip to content

Gantt Baselines

A baseline is a saved snapshot of task dates and progress at a specific point in time (e.g. when the project was approved). The Gantt chart can overlay these baseline bars beneath the live bars, making schedule drift immediately visible.

Source code
---
import GanttBaseline from './GanttBaseline.vue';
---
<GanttBaseline client:only="vue" />

Pass one or more BaselineSnapshot objects via grid.ganttBaselines:

grid.ganttBaselines = [
{
id: 'baseline-approved',
name: 'Approved Plan',
capturedAt: '2026-04-01T08:00:00Z',
tasks: [
{ taskId: 't1', startDate: '2026-04-06', endDate: '2026-04-22', durationDays: 13, progressPercent: 0 },
{ taskId: 't2', startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5, progressPercent: 0 },
{ taskId: 't3', startDate: '2026-04-10', endDate: '2026-04-10', durationDays: 0, progressPercent: 0 },
{ taskId: 't4', startDate: '2026-04-13', endDate: '2026-04-22', durationDays: 8, progressPercent: 0 },
{ taskId: 't5', startDate: '2026-04-23', endDate: '2026-05-16', durationDays: 18, progressPercent: 0 },
{ taskId: 't6', startDate: '2026-04-23', endDate: '2026-05-09', durationDays: 13, progressPercent: 0 },
{ taskId: 't7', startDate: '2026-04-23', endDate: '2026-05-16', durationDays: 18, progressPercent: 0 },
{ taskId: 't8', startDate: '2026-05-16', endDate: '2026-05-16', durationDays: 0, progressPercent: 0 },
],
},
];

Turn on baseline rendering through the visuals key in your project config:

grid.gantt = {
// …required fields
visuals: {
showBaseline: true,
baselineId: 'baseline-approved', // optional — defaults to the latest snapshot
},
};

When showBaseline is true, a translucent bar is drawn behind each live task bar showing its baseline position.

You can store several snapshots and switch between them at runtime:

// Initially show the approved plan
grid.gantt = { ...config, visuals: { showBaseline: true, baselineId: 'baseline-approved' } };
// Switch to a re-baseline after scope change
grid.gantt = { ...config, visuals: { showBaseline: true, baselineId: 'baseline-replan' } };
FieldTypeDescription
idBaselineIdUnique identifier for this snapshot
namestringHuman-readable label (e.g. "Q1 Approved Plan")
capturedAtISODateTimeStringWhen the snapshot was taken
tasksBaselineTaskSnapshot[]Per-task date and progress records
FieldTypeDescription
taskIdTaskIdReferences the live task
startDateISODateStringBaseline start date
endDateISODateStringBaseline end date
durationDaysnumberBaseline duration in calendar days
progressPercentnumberBaseline progress (0–100)