npx skills add ...
npx skills add syncfusion/angular-ui-components-skills --skill syncfusion-angular-gantt-chart
Implement and configure the Syncfusion Angular Gantt Chart component (ejs-gantt, GanttModule). Use this when building Angular applications with Gantt chart functionality, task scheduling, dependencies, or resource management. Covers component setup, task dependencies, taskbar editing, critical path analysis, resource allocation, timeline configuration, filtering, sorting, export, undo/redo, state persistence, and localization.
npx skills add syncfusion/angular-ui-components-skills --skill syncfusion-angular-gantt-chart
A comprehensive skill for implementing and configuring the Syncfusion Angular Gantt Chart component (ejs-gantt). This covers everything from initial setup through advanced features like critical path, virtual scrolling, resource views, undo/redo, state persistence, localization, export, task calendars, serial numbers, advanced scheduling units, dependency restrictions, hierarchy checkbox selection, and taskbar drawing.
Use this skill when you need to:
📄 Read: references/getting-started.md
ng add @syncfusion/ej2-angular-ganttimports and providersdataSource and taskFields — self-referential vs hierarchicalgridLines values: 'Both' | 'Horizontal' | 'Vertical' | 'None'actionFailure error handling for common configuration mistakes📄 Read: references/data-binding.md
id + parentID (idMapping + parentIdMapping) — use this unless user explicitly asks for nested datachild array — only when user explicitly requests nested/tree structureDataManager and adaptors (ODataV4, WebApiAdaptor, UrlAdaptor)loadChildOnDemand and hasChildMappingasync pipecrudUrl, insertUrl, updateUrl, removeUrl, batchUrlisPrimaryKey, wrong adaptor, parent date issues)📄 Read: references/observable-crud.md
dataSourceChanged eventBehaviorSubject for proper Observable binding(args.data as any).taskData for edit operationsargs.endEdit() after CRUD operation completes to notify Ganttargs.data.lengthsuper.next() / this.next() to refresh UI📄 Read: references/task-scheduling.md
taskMode: 'Auto' (default), 'Manual', 'Custom' (per-task via boolean field)validateManualTasksOnLinking to still adjust on linkallowUnscheduledTasks) — partial dates, floating barsdurationUnit: 'Day' | 'Hour' | 'Minute' | 'Week' | 'Month''5 days', '2 weeks', '1 month'daysPerWeek and daysPerMonth — conversion controls for week/month-based schedulingworkWeek array (default Mon–Fri); includeWeekend: true makes all 7 days workingdayWorkingTime — array of { from, to } ranges (default 8–17); affects hour-based durationsrenderBaseline, baselineStartDate, baselineEndDate, baselineDuration, baselineColor) and baselineTemplate for custom baseline renderingwork field and workUnit📄 Read: references/calendar-settings.md
calendarSettings — top-level calendar configuration for the Gantt chartcalendarSettings.projectCalendar — default working days, working hours, holidays, and exceptions for all taskscalendarSettings.taskCalendar — task-specific calendars for shift-based, team-based, or region-based schedulingtaskFields.calendarId — maps a task record to a named task calendar- calendarSettings.taskCalendar fully overrides the project calendar for matched taskshoursPerDay — converts working duration into day-based duration values for display and calculations📄 Read: references/task-dependencies.md
FS (Finish-to-Start), SS, FF, SF — format: '2FS', '3SS+1d''2FS,3SS'd/h/m unitsautoUpdatePredecessorOffset — sync offset values with actual positions on loadallowParentDependency — enable parent-child and cross-hierarchy dependenciesallowedDependencyTypes — restrict dependency creation and editing to selected typeseditSettings.allowTaskbarEditing: trueactionBegin requestType: 'validateLinkedTask' — handle dependency conflictsaddPredecessor(), removePredecessor(), updateRecordById()connectorLineWidth and connectorLineBackground for connector styling📄 Read: references/task-constraints.md
taskFields.constraintType (numeric) and taskFields.constraintDate (Date)actionBegin event📄 Read: references/managing-tasks.md
editSettings: allowEditing, allowAdding, allowDeleting, allowTaskbarEditing, mode ('Auto' | 'Dialog')editType per column: 'numericedit', 'defaultedit', 'dropdownedit', 'booleanedit', 'datepickeredit'addDialogFields, editDialogFields)addRecord(), updateRecordById(), deleteRecord(), openAddDialog(), openEditDialog(id)expandAll(), collapseAll(), expandByID(id), collapseByID(id); events: expanding, expanded, collapsing, collapsedactionBegin event (args.cancel = true to block)actionComplete + requestType inspectionindent() / outdent() methods📄 Read: references/splitting-and-merging.md
taskFields.segments for hierarchical data; taskFields.segmentId for self-referential dataSplitTaskMergeTask or by dragging segments togetheronTaskbarClick with segmentIndex to detect which segment was clicked📄 Read: references/resources.md
resources (data) + resourceFields (field mapping: id, name, unit, group)taskFields.resourceInfo to link resources to tasksviewType: 'ResourceView') with row-per-resource displayshowOverAllocationAsMultiTaskbar — stacked taskbars for over-allocated resourcesallowTaskbarOverlap — controls overlapping vs stacked taskbars in resource rows (and affects same-resource dependency rendering)work field, taskType ('FixedWork', 'FixedDuration', 'FixedUnit')workUnit: 'Hour' | 'Day' | 'Minute'📄 Read: references/calendar-settings.md
calendarId selects the task calendar used by a task recordhoursPerDay controls how day-based duration values are interpreted📄 Read: references/columns.md
field, headerText, width, format, type, template, headerTemplateallowReordering), resizing (allowResizing)freeze: 'Left' | 'Right') — requires FreezeServicequeryCellInfotreeColumnIndex for tree expand/collapse columncolumnType: 'WBS'enableSerialNumber: true and field: 'SerialNumber'showColumnMenu) — sort, filter, auto-fit, column chooserisPrimaryKey requirement for CRUD operations📄 Read: references/timeline.md
timelineSettings configuration(date, format, tier, mode) parameterstimelineUnitSize)projectStartDate and projectEndDateviewStartDate / viewEndDate)weekStartDay)updateTimescaleView)enableInfiniteTimelineScroll)timelineSettings.showWeekend)showTooltip)timelineTemplate — custom HTML in tier header cells (via <ng-template #timelineTemplate let-data> using data.date, data.value, data.tier)previousTimeSpan() / nextTimeSpan())📄 Read: references/taskbar.md
taskbarTemplate, parentTaskbarTemplate, milestoneTemplate — full custom templateslabelSettings: leftLabel, rightLabel, taskLabel (field names or templates)ng-template for rich content renderingqueryTaskbarInfo — dynamic styling: taskbarBgColor, progressBarBgColor, taskbarBorderColorindicators / data markers on individual tasks: date, iconClass, label, tooltiptooltipSettings.taskbar templatetaskbarHeight, taskbarCornerRadius, allowTaskbarDragAndDrop📄 Read: references/taskbar-draw.md
editSettings.allowTaskbarDraw — enables drawing taskbars directly on the timeline to create or schedule unscheduled tasksStartDate, EndDate, Duration generated from drawn range📄 Read: references/filtering-and-searching.md
allowFiltering: true + FilterService — menu and Excel filter typesfilterSettings.type: 'Menu' (default) | 'Excel'filterSettings.hierarchyMode: 'Parent' | 'Child' | 'Both' | 'None'filterSettings.columns arrayallowSearching: true + 'Search' in toolbarsearchSettings: fields, operator, ignoreCasefilterByColumn(), clearFiltering(), search()📄 Read: references/sorting.md
allowSorting: true + SortService — click column headers to sort{ field: 'TaskID', allowSorting: false }sortSettings.columns arraysortColumn(), removeSortColumn(), clearSorting()📄 Read: references/rows.md
rowDataBound / queryCellInfo — dynamic row/cell stylingrowHeight — uniform row height in pixels (must exceed taskbarHeight)rowSpan via queryCellInfo — vertical cell spanningallowRowDragAndDrop — drag rows to reorder/reparent; rowDrop eventsindent() / outdent() — change hierarchy level for the selected rowautoFocusTasks — focus the matching taskbar when a row is selected📄 Read: references/selection.md
allowSelection: true + SelectionService — required for any selection featureselectionSettings.mode: 'Row' (default) | 'Cell' | 'Both'selectionSettings.type: 'Single' (default) | 'Multiple' (Ctrl+click for multi-select)selectionSettings.enableToggle — click to deselect already-selected rowselectionSettings.hierarchyMode / hierarchy checkbox selection modes: 'Self' | 'Hierarchy' | 'FilteredHierarchy''Flow' | 'Box' | 'BoxWithBorder'selectRow(), selectRows(), selectCell(), clearSelection(), getSelectedRecords()📄 Read: references/scrolling.md
enableVirtualization: true + VirtualScrollService — DOM virtualization for large datasetsenableTimelineVirtualization — virtualize timeline columns independentlysplitterSettings.position (percentage string or pixel value), columnIndex, view ('Default' | 'Grid' | 'Chart')scrollToDate('04/02/2024'), scrollToTaskbar(taskId)📄 Read: references/toolbar.md
ToolbarService required; set toolbar as string array or mixed ItemModel array'Add', 'Edit', 'Delete', 'Update', 'Cancel', 'ExpandAll', 'CollapseAll', 'Search', 'Indent', 'Outdent', 'ZoomIn', 'ZoomOut', 'ZoomToFit', 'ExcelExport', 'CsvExport', 'PdfExport', 'CriticalPath', 'Undo', 'Redo', 'SplitTask', 'MergeTask', 'ColumnChooser'ItemModel: text, id, prefixIcon, align, tooltipText{ type: 'Separator' } for visual dividerstoolbarClick event — use args.item.id to identify clicked item (format: '{ganttId}_{itemId}')enableToolbarItems() / disableToolbarItems()📄 Read: references/gantt-methods.md
autoFitColumns()cancelEdit(), openAddDialog(), openEditDialog()deleteRecord(), convertToMilestone(), changeTaskMode(), updateRecordByID(), updateRecordByIndex(), updateTaskId(), updateDataSource(), updateProjectDates()enableItems()expandByIndex(), expandByID(), collapseByIndex(), collapseByID()clearUndoCollection(), clearRedoCollection(), getUndoActions(), getRedoActions()getCurrentViewData(), getRecordByID(), getTaskByUniqueID(), getTaskInfo(), getTaskbarHeight(), getExpandedRecords(), getGanttColumns(), getGridColumns()getDurationString(), getWorkString()getRowByID(), getRowByIndex()removeSortColumn()selectCells()reorderRows()scrollToTask(), updateChartScrollOffset()📄 Read: references/events.md
load, created, dataBound, destroyedactionBegin (cancel with args.cancel = true), actionComplete, actionFailuretaskbarEditing, taskbarEdited, onTaskbarClick, queryTaskbarInforowDataBound, queryCellInfo, rowSelected, rowDeselected, cellSelectedexpanding, expanded, collapsing, collapsedbeforeExcelExport, excelExportComplete, beforePdfExport, pdfExportComplete, pdfQueryTaskbarInforecordDoubleClick — open custom edit on double click📄 Read: references/context-menu.md
enableContextMenu: true + ContextMenuService — right-click on rows or header'AutoFitAll', 'AutoFit', 'SortAscending', 'SortDescending', 'Add', 'Edit', 'Delete', 'Save', 'Cancel', 'Indent', 'Outdent', 'TaskInformation', 'SplitTask', 'MergeTask'ContextMenuItemModel: text, id, iconCss, target (row/header)contextMenuOpen — dynamically hide/show items per rowcontextMenuClick — handle item selection📄 Read: references/holidays-and-markers.md
DayMarkersService required for both holidays and event markersholidays: array of { from, to?, label, cssClass } — non-working days that extend task durationseventMarkers: array of { day, label, cssClass, top? } — full-height vertical lines at specific datescssClass + CSS targeting .e-gantt-event-marker / .e-span-labeltop property staggers overlapping markers at the same date📄 Read: references/critical-path.md
enableCriticalPath: true + CriticalPathService — highlights zero/negative-slack tasks in red'CriticalPath' toolbar item — user toggle buttongetCriticalTasks() — returns array of IGanttData objects with slack valuequeryTaskbarInfo + ganttProperties.isCritical — conditional per-task coloring.e-critical-path-container, .e-critical-connector-line📄 Read: references/export.md
allowExcelExport: true + ExcelExportService; call excelExport() / csvExport()allowPdfExport: true + PdfExportService; call pdfExport()ExcelExportProperties: fileName, dataSource, includeHiddenColumn, header, footerPdfExportProperties: fileName, pageOrientation, pageSize, fitToWidthSettings, ganttStyle, themeText, Line, PageNumber, ImagefitToWidthSettings.isFitToWidth: truepdfExport({}, true) → blob available in pdfExportComplete eventpdfExport() with multipleExportpdfQueryTaskbarInfo — per-taskbar colors in PDF output📄 Read: references/undo-redo.md
enableUndoRedo: true + UndoRedoService — up to 10 steps by defaultundoRedoActions array — choose which action types are tracked (18 supported actions)undoRedoStepsCount — configure history depthCtrl+Z / Ctrl+Y; programmatic: undo() / redo()'Undo' / 'Redo' toolbar items auto-disable when history is exhausted📄 Read: references/state-persistence.md
enablePersistence: true — saves filter/sort/column state to localStorage under key '{id}gantt'id on <ejs-gantt> elementclearStorage(), remove localStorage key manually, or set new idenableImmutableMode) — only re-renders changed rows for large-dataset performanceloadingIndicator.indicatorType — 'Spinner' (default) | 'Shimmer'showSpinner() / hideSpinner()📄 Read: references/localization-rtl.md
locale property + setCulture() + L10n.load() — translate all Gantt UI strings'gantt' namespace[enableRtl]="true" + locale="ar" — reverses layout directiontimezone — IANA timezone string (e.g. 'America/New_York', 'UTC') for consistent cross-region datesformat string or { type: 'date', skeleton: 'yMd' }'N2', 'C2', 'P1' etc.→ Set editSettings.allowEditing: true, inject EditService
→ Use mode: 'Auto' for cell editing, mode: 'Dialog' for dialog
→ Read references/scrolling.md — enable enableVirtualization: true + VirtualScrollService
→ Read references/export.md — inject ExcelExportService or PdfExportService
→ Read references/resources.md — configure resources + resourceFields
→ Read references/calendar-settings.md — configure calendarSettings, calendarId, and hoursPerDay
→ Read references/undo-redo.md — inject UndoRedoService, set enableUndoRedo: true
→ Read references/localization-rtl.md — call L10n.load() before bootstrap, set locale and enableRtl
→ Read references/state-persistence.md — set enablePersistence: true and unique id
→ Read references/splitting-and-merging.md — map taskFields.segments, inject EditService
| Feature | Service to Inject |
|---|---|
| Editing (add/edit/delete/taskbar drag) | EditService |
| Filtering | FilterService |
| Sorting | SortService |
| Toolbar | ToolbarService |
| Selection | SelectionService |
| Day Markers / Holidays / Event Markers | DayMarkersService |
| Critical Path | CriticalPathService |
| Excel / CSV Export | ExcelExportService |
| PDF Export | PdfExportService |
| Undo / Redo | UndoRedoService |
| Column Menu | ColumnMenuService |
| Context Menu | ContextMenuService |
| Virtual Scrolling | VirtualScrollService |
| Row Drag and Drop | RowDDService |
| Column Reordering | ReorderService |
| Frozen Columns | FreezeService |
| Column Resizing | ResizeService |
| Property | Type | Default | Description |
|---|---|---|---|
dataSource | object[] | DataManager | [] | Task data — self-referential (flat) or hierarchical |
taskFields | TaskFieldsModel | — | Maps data fields to Gantt task properties |
height | string | number | 'auto' | Component height (e.g. '450px') |
taskMode | string | 'Auto' | Scheduling mode: 'Auto' | 'Manual' | 'Custom' |
editSettings | EditSettingsModel | — | Enable add/edit/delete/taskbar editing and edit mode |
toolbar | string[] | ItemModel[] | — | Toolbar buttons — requires ToolbarService |
allowFiltering | boolean | false | Enable column filter menus — requires FilterService |
filterSettings | FilterSettingsModel | — | type, hierarchyMode, columns (initial filters) |
allowSorting | boolean | false | Enable column sorting — requires SortService |
sortSettings | SortSettingsModel | — | columns array for initial sort on load |
allowSelection | boolean | true | Enable row/cell selection — requires SelectionService |
selectionSettings | SelectionSettingsModel | — | mode, type, enableToggle, cellSelectionMode |
enableCriticalPath | boolean | false | Highlight critical path — requires CriticalPathService |
enableUndoRedo | boolean | false | Enable undo/redo — requires UndoRedoService |
undoRedoActions | string[] | (all actions) | Which action types to track in history |
undoRedoStepsCount | number | 10 | Maximum undo/redo history depth |
enablePersistence | boolean | false | Persist filter/sort/column state to localStorage |
enableImmutableMode | boolean | false | Re-render only changed rows on data refresh |
allowExcelExport | boolean | false | Enable Excel export — requires ExcelExportService |
allowPdfExport | boolean | false | Enable PDF export — requires PdfExportService |
enableContextMenu | boolean | false | Enable right-click context menu — requires ContextMenuService |
contextMenuItems | string[] | ContextMenuItemModel[] | (defaults) | Context menu items |
enableVirtualization | boolean | false | DOM virtualization for large datasets — requires VirtualScrollService |
enableTimelineVirtualization | boolean | false | Virtualize timeline columns |
renderBaseline | boolean | false | Show baseline bars alongside current taskbars |
baselineTemplate | string | TemplateRef | — | Custom template for rendering baseline bars |
baselineColor | string | 'red' | Baseline bar color |
allowUnscheduledTasks | boolean | false | Allow tasks missing start/end/duration |
validateManualTasksOnLinking | boolean | false | Adjust manual task dates when dependency links change |
allowParentDependency | boolean | true | Allow dependencies between parent/child tasks |
autoUpdatePredecessorOffset | boolean | false | Sync predecessor offsets with actual positions on load |
enableInfiniteTimelineScroll | boolean | false | Enable infinite horizontal timeline scrolling |
highlightWeekends | boolean | false | Shade weekend columns in timeline |
gridLines | string | 'Both' | Grid lines: 'Both' | 'Horizontal' | 'Vertical' | 'None' |
rowHeight | number | 36 | Height of each row in pixels |
allowRowDragAndDrop | boolean | false | Drag rows to reorder or reparent |
showColumnMenu | boolean | false | Column header context menu — requires ColumnMenuService |
timelineSettings | TimelineSettingsModel | — | topTier, bottomTier, timelineUnitSize, weekStartDay |
timelineViewMode | string | — | Shortcut: 'Hour' | 'Day' | 'Week' | 'Month' | 'Year' |
projectStartDate | Date | string | (from data) | Fix timeline start bound |
projectEndDate | Date | string | (from data) | Fix timeline end bound |
holidays | HolidayModel[] | [] | Non-working days with labels — requires DayMarkersService |
eventMarkers | EventMarkerModel[] | [] | Vertical marker lines — requires DayMarkersService |
resources | object[] | — | Resource data array |
resourceFields | ResourceFieldsModel | — | Maps resource id, name, unit, group fields |
locale | string | 'en-US' | Culture code for localization (e.g. 'fr', 'ar') |
enableRtl | boolean | false | Right-to-left layout |
timezone | string | (browser) | IANA timezone (e.g. 'UTC', 'America/New_York') |
durationUnit | string | 'Day' | Default duration unit: 'Day' | 'Hour' | 'Minute' |
workUnit | string | 'Hour' | Work scheduling unit: 'Hour' | 'Day' | 'Minute' |
workWeek | string[] | Mon–Fri | Working days: ['Monday','Tuesday','Wednesday','Thursday','Friday'] |
includeWeekend | boolean | false | Treat all 7 days as working days |
dayWorkingTime | object[] | [{from:8,to:17}] | Working hour ranges per day: [{ from: 8, to: 12 }, { from: 13, to: 17 }] |
dateFormat | string | 'MM/dd/yyyy' | Global date display format for all date columns |
splitterSettings | SplitterSettingsModel | — | position, columnIndex, view for TreeGrid/chart split |
loadingIndicator | LoadingIndicatorModel | — | indicatorType: 'Spinner' | 'Shimmer' |
import { Component } from '@angular/core';
import { GanttModule, EditService, SortService, FilterService, ToolbarService, SelectionService } from '@syncfusion/ej2-angular-gantt';
@Component({
imports: [GanttModule],
standalone: true,
providers: [EditService, SortService, FilterService, ToolbarService, SelectionService],
selector: 'app-root',
template: `
<ejs-gantt
[dataSource]="data"
[taskFields]="taskFields"
[height]="'450px'"
[toolbar]="toolbar"
[allowFiltering]="true"
[allowSorting]="true"
[editSettings]="editSettings">
</ejs-gantt>
`
})
export class AppComponent {
// Default: self-referential data (flat array with id + parentID)
// Use hierarchical (child array) only if user explicitly requests it
public data: object[] = [
{ TaskID: 1, TaskName: 'Project Initiation', StartDate: new Date('04/02/2024'), Duration: 5, Progress: 0, ParentID: null },
{ TaskID: 2, TaskName: 'Identify Site location', StartDate: new Date('04/02/2024'), Duration: 4, Progress: 50, ParentID: 1 },
{ TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2024'), Duration: 4, Progress: 50, ParentID: 1 },
{ TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2024'), Duration: 4, Progress: 50, ParentID: 1, Predecessor: '3FS' }
];
public taskFields: object = {
id: 'TaskID', // idMapping
name: 'TaskName',
startDate: 'StartDate',
duration: 'Duration',
progress: 'Progress',
dependency: 'Predecessor',
parentID: 'ParentID' // parentIdMapping — null = root task
};
public toolbar: string[] = ['Add', 'Edit', 'Delete', 'ExpandAll', 'CollapseAll', 'Search'];
public editSettings: object = { allowEditing: true, allowAdding: true, allowDeleting: true, allowTaskbarEditing: true };
}