Basic Gantt Chart
A Gantt chart is built from three core pieces: a project config, a list of tasks (your source), and one or more calendars.
Dependencies between tasks are optional but common.
Source code
import { defineCustomElements } from '@revolist/revogrid/loader';defineCustomElements();
import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/revogrid-enterprise';import type { TaskEntity, DependencyEntity, CalendarEntity } from '@revolist/revogrid-enterprise';import { currentTheme } from '../composables/useRandomData';
const { isDark } = currentTheme();
const PROJECT_ID = 'project-web-redesign';const CALENDAR_ID = 'cal-standard';
const ganttConfig = { id: PROJECT_ID, name: 'Website Redesign', version: '1', currency: 'USD', timeZone: 'UTC', primaryCalendarId: CALENDAR_ID, updatedAt: '2026-04-06T00:00:00Z', zoomPreset: 'week' as const,};
const calendars: CalendarEntity[] = [ { id: CALENDAR_ID, name: 'Standard', timeZone: 'UTC', workingDays: [1, 2, 3, 4, 5], holidays: [], hoursPerDay: 8, },];
const tasks: TaskEntity[] = [ { id: 't1', projectId: PROJECT_ID, parentId: null, wbsCode: '1', name: 'Design', type: 'summary', status: 'in-progress', startDate: '2026-04-06', endDate: '2026-04-24', durationDays: 15, progressPercent: 60, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't2', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.1', name: 'Wireframes', type: 'task', status: 'done', startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't3', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.2', name: 'Design Review', type: 'milestone', status: 'done', startDate: '2026-04-10', endDate: '2026-04-10', durationDays: 0, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], }, { id: 't4', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.3', name: 'Visual Design', type: 'task', status: 'in-progress', startDate: '2026-04-13', endDate: '2026-04-24', durationDays: 10, progressPercent: 40, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't5', projectId: PROJECT_ID, parentId: null, wbsCode: '2', name: 'Development', type: 'summary', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't6', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.1', name: 'Frontend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-13', durationDays: 13, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't7', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.2', name: 'Backend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't8', projectId: PROJECT_ID, parentId: null, wbsCode: '3', name: 'Launch', type: 'milestone', status: 'not-started', startDate: '2026-05-20', endDate: '2026-05-20', durationDays: 0, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], },];
const dependencies: DependencyEntity[] = [ { id: 'd1', predecessorTaskId: 't2', successorTaskId: 't3', type: 'finish-to-start', lagDays: 0 }, { id: 'd2', predecessorTaskId: 't3', successorTaskId: 't4', type: 'finish-to-start', lagDays: 1 }, { id: 'd3', predecessorTaskId: 't4', successorTaskId: 't6', type: 'finish-to-start', lagDays: 1 }, { id: 'd4', predecessorTaskId: 't4', successorTaskId: 't7', type: 'finish-to-start', lagDays: 1 }, { id: 'd5', predecessorTaskId: 't6', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 }, { id: 'd6', predecessorTaskId: 't7', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 },];
export function load(parentSelector: string) { const grid = document.createElement('revo-grid');
grid.theme = isDark() ? 'darkCompact' : 'compact'; grid.hideAttribution = true; grid.plugins = [GanttPlugin]; grid.gantt = ganttConfig; grid.ganttCalendars = calendars; grid.ganttDependencies = dependencies; grid.source = tasks; grid.columns = [ createDefaultTaskTableColumn('wbs'), createDefaultTaskTableColumn('name'), createDefaultTaskTableColumn('startDate'), createDefaultTaskTableColumn('endDate'), createDefaultTaskTableColumn('duration'), createDefaultTaskTableColumn('percentDone'), ];
document.querySelector(parentSelector)?.appendChild(grid);}<template> <RevoGrid hide-attribution style="height: 500px" :theme="isDark ? 'darkCompact' : 'compact'" :plugins="plugins" :source="tasks" :columns="columns" :gantt.prop="ganttConfig" :gantt-dependencies.prop="dependencies" :gantt-calendars.prop="calendars" /></template>
<script setup lang="ts">import { ref } from 'vue';import RevoGrid from '@revolist/vue3-datagrid';import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/revogrid-enterprise';import type { TaskEntity, DependencyEntity, CalendarEntity } from '@revolist/revogrid-enterprise';import { currentThemeVue } from '../composables/useRandomData';
const { isDark } = currentThemeVue();
const PROJECT_ID = 'project-web-redesign';const CALENDAR_ID = 'cal-standard';
const plugins = ref([GanttPlugin]);
const ganttConfig = ref({ id: PROJECT_ID, name: 'Website Redesign', version: '1', currency: 'USD', timeZone: 'UTC', primaryCalendarId: CALENDAR_ID, updatedAt: '2026-04-06T00:00:00Z', zoomPreset: 'week' as const,});
const calendars = ref<CalendarEntity[]>([ { id: CALENDAR_ID, name: 'Standard', timeZone: 'UTC', workingDays: [1, 2, 3, 4, 5], holidays: [], hoursPerDay: 8, },]);
const tasks = ref<TaskEntity[]>([ { id: 't1', projectId: PROJECT_ID, parentId: null, wbsCode: '1', name: 'Design', type: 'summary', status: 'in-progress', startDate: '2026-04-06', endDate: '2026-04-24', durationDays: 15, progressPercent: 60, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't2', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.1', name: 'Wireframes', type: 'task', status: 'done', startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't3', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.2', name: 'Design Review', type: 'milestone', status: 'done', startDate: '2026-04-10', endDate: '2026-04-10', durationDays: 0, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], }, { id: 't4', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.3', name: 'Visual Design', type: 'task', status: 'in-progress', startDate: '2026-04-13', endDate: '2026-04-24', durationDays: 10, progressPercent: 40, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't5', projectId: PROJECT_ID, parentId: null, wbsCode: '2', name: 'Development', type: 'summary', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't6', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.1', name: 'Frontend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-13', durationDays: 13, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't7', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.2', name: 'Backend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't8', projectId: PROJECT_ID, parentId: null, wbsCode: '3', name: 'Launch', type: 'milestone', status: 'not-started', startDate: '2026-05-20', endDate: '2026-05-20', durationDays: 0, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], },]);
const dependencies = ref<DependencyEntity[]>([ { id: 'd1', predecessorTaskId: 't2', successorTaskId: 't3', type: 'finish-to-start', lagDays: 0 }, { id: 'd2', predecessorTaskId: 't3', successorTaskId: 't4', type: 'finish-to-start', lagDays: 1 }, { id: 'd3', predecessorTaskId: 't4', successorTaskId: 't6', type: 'finish-to-start', lagDays: 1 }, { id: 'd4', predecessorTaskId: 't4', successorTaskId: 't7', type: 'finish-to-start', lagDays: 1 }, { id: 'd5', predecessorTaskId: 't6', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 }, { id: 'd6', predecessorTaskId: 't7', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 },]);
const columns = ref([ createDefaultTaskTableColumn('wbs'), createDefaultTaskTableColumn('name'), createDefaultTaskTableColumn('startDate'), createDefaultTaskTableColumn('endDate'), createDefaultTaskTableColumn('duration'), createDefaultTaskTableColumn('percentDone'),]);</script>import React, { useMemo } from 'react';import { RevoGrid } from '@revolist/react-datagrid';import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/revogrid-enterprise';import type { TaskEntity, DependencyEntity, CalendarEntity } from '@revolist/revogrid-enterprise';import { currentTheme } from '../composables/useRandomData';
const { isDark } = currentTheme();
const PROJECT_ID = 'project-web-redesign';const CALENDAR_ID = 'cal-standard';
const tasks: TaskEntity[] = [ { id: 't1', projectId: PROJECT_ID, parentId: null, wbsCode: '1', name: 'Design', type: 'summary', status: 'in-progress', startDate: '2026-04-06', endDate: '2026-04-24', durationDays: 15, progressPercent: 60, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't2', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.1', name: 'Wireframes', type: 'task', status: 'done', startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't3', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.2', name: 'Design Review', type: 'milestone', status: 'done', startDate: '2026-04-10', endDate: '2026-04-10', durationDays: 0, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], }, { id: 't4', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.3', name: 'Visual Design', type: 'task', status: 'in-progress', startDate: '2026-04-13', endDate: '2026-04-24', durationDays: 10, progressPercent: 40, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't5', projectId: PROJECT_ID, parentId: null, wbsCode: '2', name: 'Development', type: 'summary', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't6', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.1', name: 'Frontend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-13', durationDays: 13, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't7', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.2', name: 'Backend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't8', projectId: PROJECT_ID, parentId: null, wbsCode: '3', name: 'Launch', type: 'milestone', status: 'not-started', startDate: '2026-05-20', endDate: '2026-05-20', durationDays: 0, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], },];
const dependencies: DependencyEntity[] = [ { id: 'd1', predecessorTaskId: 't2', successorTaskId: 't3', type: 'finish-to-start', lagDays: 0 }, { id: 'd2', predecessorTaskId: 't3', successorTaskId: 't4', type: 'finish-to-start', lagDays: 1 }, { id: 'd3', predecessorTaskId: 't4', successorTaskId: 't6', type: 'finish-to-start', lagDays: 1 }, { id: 'd4', predecessorTaskId: 't4', successorTaskId: 't7', type: 'finish-to-start', lagDays: 1 }, { id: 'd5', predecessorTaskId: 't6', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 }, { id: 'd6', predecessorTaskId: 't7', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 },];
const calendars: CalendarEntity[] = [ { id: CALENDAR_ID, name: 'Standard', timeZone: 'UTC', workingDays: [1, 2, 3, 4, 5], holidays: [], hoursPerDay: 8, },];
function GanttBasic() { const ganttConfig = useMemo(() => ({ id: PROJECT_ID, name: 'Website Redesign', version: '1', currency: 'USD', timeZone: 'UTC', primaryCalendarId: CALENDAR_ID, updatedAt: '2026-04-06T00:00:00Z', zoomPreset: 'week' as const, }), []);
const columns = useMemo(() => [ createDefaultTaskTableColumn('wbs'), createDefaultTaskTableColumn('name'), createDefaultTaskTableColumn('startDate'), createDefaultTaskTableColumn('endDate'), createDefaultTaskTableColumn('duration'), createDefaultTaskTableColumn('percentDone'), ], []);
return ( <RevoGrid style={{ height: '500px' }} theme={isDark() ? 'darkCompact' : 'compact'} hideAttribution plugins={[GanttPlugin]} source={tasks} columns={columns} gantt={ganttConfig} ganttDependencies={dependencies} ganttCalendars={calendars} /> );}
export default GanttBasic;import { Component, NO_ERRORS_SCHEMA, ViewEncapsulation } from '@angular/core';import { RevoGrid } from '@revolist/angular-datagrid';import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/revogrid-enterprise';import type { TaskEntity, DependencyEntity, CalendarEntity } from '@revolist/revogrid-enterprise';import { currentTheme } from '../composables/useRandomData';
const PROJECT_ID = 'project-web-redesign';const CALENDAR_ID = 'cal-standard';
@Component({ selector: 'gantt-basic', standalone: true, schemas: [NO_ERRORS_SCHEMA], imports: [RevoGrid], template: ` <revo-grid style="height: 500px" [theme]="theme" [hideAttribution]="true" [plugins]="plugins" [source]="tasks" [columns]="columns" [gantt]="ganttConfig" [ganttDependencies]="dependencies" [ganttCalendars]="calendars" ></revo-grid> `, encapsulation: ViewEncapsulation.None,})export class GanttBasicComponent { theme = currentTheme().isDark() ? 'darkCompact' : 'compact'; plugins = [GanttPlugin];
ganttConfig = { id: PROJECT_ID, name: 'Website Redesign', version: '1', currency: 'USD', timeZone: 'UTC', primaryCalendarId: CALENDAR_ID, updatedAt: '2026-04-06T00:00:00Z', zoomPreset: 'week' as const, };
calendars: CalendarEntity[] = [ { id: CALENDAR_ID, name: 'Standard', timeZone: 'UTC', workingDays: [1, 2, 3, 4, 5], holidays: [], hoursPerDay: 8, }, ];
tasks: TaskEntity[] = [ { id: 't1', projectId: PROJECT_ID, parentId: null, wbsCode: '1', name: 'Design', type: 'summary', status: 'in-progress', startDate: '2026-04-06', endDate: '2026-04-24', durationDays: 15, progressPercent: 60, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't2', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.1', name: 'Wireframes', type: 'task', status: 'done', startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't3', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.2', name: 'Design Review', type: 'milestone', status: 'done', startDate: '2026-04-10', endDate: '2026-04-10', durationDays: 0, progressPercent: 100, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], }, { id: 't4', projectId: PROJECT_ID, parentId: 't1', wbsCode: '1.3', name: 'Visual Design', type: 'task', status: 'in-progress', startDate: '2026-04-13', endDate: '2026-04-24', durationDays: 10, progressPercent: 40, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't5', projectId: PROJECT_ID, parentId: null, wbsCode: '2', name: 'Development', type: 'summary', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't6', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.1', name: 'Frontend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-13', durationDays: 13, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: [], }, { id: 't7', projectId: PROJECT_ID, parentId: 't5', wbsCode: '2.2', name: 'Backend', type: 'task', status: 'not-started', startDate: '2026-04-27', endDate: '2026-05-20', durationDays: 18, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: false, tags: [], }, { id: 't8', projectId: PROJECT_ID, parentId: null, wbsCode: '3', name: 'Launch', type: 'milestone', status: 'not-started', startDate: '2026-05-20', endDate: '2026-05-20', durationDays: 0, progressPercent: 0, calendarId: CALENDAR_ID, isCritical: true, tags: ['milestone'], }, ];
dependencies: DependencyEntity[] = [ { id: 'd1', predecessorTaskId: 't2', successorTaskId: 't3', type: 'finish-to-start', lagDays: 0 }, { id: 'd2', predecessorTaskId: 't3', successorTaskId: 't4', type: 'finish-to-start', lagDays: 1 }, { id: 'd3', predecessorTaskId: 't4', successorTaskId: 't6', type: 'finish-to-start', lagDays: 1 }, { id: 'd4', predecessorTaskId: 't4', successorTaskId: 't7', type: 'finish-to-start', lagDays: 1 }, { id: 'd5', predecessorTaskId: 't6', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 }, { id: 'd6', predecessorTaskId: 't7', successorTaskId: 't8', type: 'finish-to-start', lagDays: 0 }, ];
columns = [ createDefaultTaskTableColumn('wbs'), createDefaultTaskTableColumn('name'), createDefaultTaskTableColumn('startDate'), createDefaultTaskTableColumn('endDate'), createDefaultTaskTableColumn('duration'), createDefaultTaskTableColumn('percentDone'), ];}-
Install the enterprise package
Terminal window npm install @revolist/revogrid-enterprise -
Import the plugin
import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/revogrid-enterprise'; -
Configure the project
The
ganttproperty on the grid element accepts aGanttPluginConfigdescribing the project:grid.gantt = {id: 'project-website',name: 'Website Redesign',version: '1',currency: 'USD',timeZone: 'UTC',primaryCalendarId: 'cal-standard',updatedAt: '2026-04-06T00:00:00Z',zoomPreset: 'week',}; -
Supply tasks as the data source
Tasks map to rows. Set them via
grid.source. UseparentId: nullfor root tasks and a task’sidfor children:grid.source = [{id: 't1', parentId: null, wbsCode: '1',name: 'Design', type: 'summary',status: 'in-progress',startDate: '2026-04-06', endDate: '2026-04-24', durationDays: 15,progressPercent: 60, calendarId: 'cal-standard',isCritical: false, tags: [],},{id: 't2', parentId: 't1', wbsCode: '1.1',name: 'Wireframes', type: 'task',status: 'done',startDate: '2026-04-06', endDate: '2026-04-10', durationDays: 5,progressPercent: 100, calendarId: 'cal-standard',isCritical: false, tags: [],},// …more tasks]; -
Add a calendar
grid.ganttCalendars = [{id: 'cal-standard',name: 'Standard',timeZone: 'UTC',workingDays: [1, 2, 3, 4, 5], // Mon–Friholidays: [],hoursPerDay: 8,}]; -
Add dependencies (optional)
grid.ganttDependencies = [{id: 'd1',predecessorTaskId: 't2',successorTaskId: 't3',type: 'finish-to-start',lagDays: 0,}]; -
Define table columns
grid.columns = [createDefaultTaskTableColumn('wbs'),createDefaultTaskTableColumn('name'),createDefaultTaskTableColumn('startDate'),createDefaultTaskTableColumn('endDate'),createDefaultTaskTableColumn('duration'),createDefaultTaskTableColumn('percentDone'),];
Task Types
Section titled “Task Types”| Type | Description |
|---|---|
'task' | Regular work item — has its own startDate, endDate, durationDays |
'summary' | Parent task — dates roll up from children automatically |
'milestone' | Zero-duration marker — durationDays: 0, startDate === endDate |
Dependency Types
Section titled “Dependency Types”| Type | Meaning |
|---|---|
finish-to-start | Successor starts after predecessor finishes (most common) |
start-to-start | Both tasks start at the same time |
finish-to-finish | Both tasks finish at the same time |
start-to-finish | Successor finishes when predecessor starts |
Use lagDays to add a buffer (positive) or overlap (negative) between linked tasks.