Resources
Assignments carry units (a number for every assigned resource, an array per resource or an id map); with effortDriven the work in hours and the assigned units decide a task's length. The utilization histogram shows the load per period against each resource's capacity, and the resource view regroups the plan by person.
Units, work & utilization
Bora works half time (capacity: 50) and is booked at 100% on the database while also running monitoring — the histogram turns those periods red. Edit a task (double-click), change its people or units: with effortDriven the finish follows work ÷ (8h × Σ units).
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { OgeGantt } from '@oge-ui/gantt';
import type { OgeGanttColumn, OgeGanttResource } from '@oge-ui/gantt';
@Component({
selector: 'demo-root',
imports: [OgeGantt],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- units (%) per assignment, work in hours and effortDriven: changing
a task's people, units or work recomputes its finish. The histogram
sums units per period against each resource's capacity line —
over-allocated periods turn red. -->
<oge-gantt
[tasks]="tasks"
[resources]="resources"
[columns]="columns"
[effortDriven]="true"
[hoursPerDay]="8"
[showResourceHistogram]="true"
style="height: 460px"
/>
`,
})
export class Demo {
protected readonly columns: OgeGanttColumn[] = [
{ field: 'title' },
{ field: 'resources' },
{ field: 'units' },
{ field: 'effort' },
];
protected readonly resources: OgeGanttResource[] = [
{ id: 1, text: 'Ana' },
{ id: 2, text: 'Bora', capacity: 50 }, // half time
{ id: 3, text: 'Cem' },
];
protected readonly tasks = [
{ id: 1, title: 'API design', start: new Date(2026, 7, 3), end: new Date(2026, 7, 7), resourceId: [1], effort: 32 },
{
id: 2,
title: 'Database',
start: new Date(2026, 7, 5),
end: new Date(2026, 7, 11),
resourceId: [1, 2],
units: [50, 100], // per assignment, in %
effort: 40,
},
{ id: 3, title: 'Monitoring', start: new Date(2026, 7, 6), end: new Date(2026, 7, 10), resourceId: [2], effort: 16 },
{ id: 4, title: 'Load tests', start: new Date(2026, 7, 11), end: new Date(2026, 7, 14), resourceId: [3], effort: 24 },
];
}Resource view
viewMode: 'resources' lists every resource as a group with its tasks underneath (a task with two people appears twice); tasks without a resource gather under Unassigned. Dragging an assignment bar moves the real task. The toolbar toggle flips the view.
View: resources
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeGantt } from '@oge-ui/gantt';
import type { OgeGanttResource, OgeGanttViewMode } from '@oge-ui/gantt';
@Component({
selector: 'demo-root',
imports: [OgeGantt],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- viewMode 'resources' regroups the rows by resource (the toolbar's
Resource view toggle flips it); assignment rows edit the real task. -->
<oge-gantt
[tasks]="tasks"
[resources]="resources"
[(viewMode)]="view"
style="height: 420px"
/>
<p>View: {{ view() }}</p>
`,
})
export class Demo {
protected readonly view = signal<OgeGanttViewMode>('resources');
protected readonly resources: OgeGanttResource[] = [
{ id: 1, text: 'Ana' },
{ id: 2, text: 'Bora', capacity: 50 }, // half time
{ id: 3, text: 'Cem' },
];
protected readonly tasks = [
{ id: 1, title: 'API design', start: new Date(2026, 7, 3), end: new Date(2026, 7, 7), resourceId: [1], effort: 32 },
{
id: 2,
title: 'Database',
start: new Date(2026, 7, 5),
end: new Date(2026, 7, 11),
resourceId: [1, 2],
units: [50, 100], // per assignment, in %
effort: 40,
},
{ id: 3, title: 'Monitoring', start: new Date(2026, 7, 6), end: new Date(2026, 7, 10), resourceId: [2], effort: 16 },
{ id: 4, title: 'Load tests', start: new Date(2026, 7, 11), end: new Date(2026, 7, 14), resourceId: [3], effort: 24 },
];
}