Resource Histogram
ProEach person's load per day, week or month against their capacity — over-capacity bars red and hatched, the figures in a hidden table.
Complexity tier: Application The interactive bar, plus a stated data-volume ceiling, a persistence contract, a bundle budget and an accessible parity surface.
import { SvGanttResourceHistogramComponent } from '@styloviz-pro/gantt';Demo & usage
Basic usage
Usage example — open the gallery for the full interactive demo.
An interactive demo for this component lives in the gallery.
Open live demoMore examples
Under the chart, before and after levelling
The same inputs as the chart; `svGanttLevelResources` gives the levelled tasks.
When to use
A plan with shared people, where "who is overbooked, and when" is the question. A single-person plan does not need one.
Async states
- loading
- error
- retry
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| tasks | readonly GanttChartTask[] | [] | The plan. |
| resources | readonly GanttChartResource[] | [] | People and their capacity (percent, 100 = full time). |
| assignments | readonly GanttChartAssignment[] | [] | Who works on what, at what allocation. |
| startrequired | string | — | First day shown (`YYYY-MM-DD`). |
| endrequired | string | — | Last day shown (`YYYY-MM-DD`). |
| bucket | SvGanttBucket | 'week' | Bar width. |
| workWeek | readonly number[] | [1, 2, 3, 4, 5] | Working days, 0 = Sunday. |
| holidays | readonly GanttChartHoliday[] | [] | Non-working dates. |
| ariaLabel | string | '' | Accessible name. Defaults to the "Resource load" label. |
| locale | string | svLocale() | Locale for dates. |
| loading | boolean | false | The plan or the assignments are still loading: a placeholder instead of the bands, which would otherwise read "nobody is assigned". |
| error | SvDataError | string | null | null | Load failure, shown with Try again. A bare string is the message. |
Outputs
| Event | Payload type | Description |
|---|---|---|
| retry | void | Try again on the error state — reload the plan. |
Wire it to your API
This component is headless about transport: it renders what you give it and reports what the user asks for. Nothing below requires @styloviz/data — drive it from whatever you already use.
Template
Bound to the names this component actually exposes.
Host class
Drive the three async inputs from your own fetch.
This component does not emit a query, so it renders what you give it. Call `load()` on your own trigger and bind `tasks`, `loading` and `error`. Normalize failures with `toSvDataError()` from `@styloviz/core`. It derives `retryable` from the status, so a 404 does not get a "Try again" button that can only fail again.
Full walkthrough: Connecting to a backend.
Customization & theming
`bucket` (`day` · `week` · `month`), `workWeek`, `holidays`, `ariaLabel`, `locale`.
Best practices
Do: Use the same `workWeek` and `holidays` as the chart, so a holiday is not counted as load. Tip: `svGanttResourceLoad` returns the same numbers for a report or an alert of your own.
Accessibility
A labelled section; the bars are hidden from assistive tech and a `sr-only` table carries every resource × period figure, with over-capacity said in words.
Feedback on Resource Histogram
Spotted a gap in this page, or something that didn't work as described? Comments are GitHub Discussions in the public styloviz/community repo, so posting needs a GitHub account.