Resource Histogram

Pro

Each person's load per day, week or month against their capacity — over-capacity bars red and hatched, the figures in a hidden table.

</>sv-gantt-resource-histogram ganttresourcescapacity

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

Pro

Usage example — open the gallery for the full interactive demo.

Pro

An interactive demo for this component lives in the gallery.

Open live demo

More examples

Under the chart, before and after levelling

Pro

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

NameTypeDefaultDescription
tasksreadonly GanttChartTask[][]The plan.
resourcesreadonly GanttChartResource[][]People and their capacity (percent, 100 = full time).
assignmentsreadonly GanttChartAssignment[][]Who works on what, at what allocation.
startrequiredstring—First day shown (`YYYY-MM-DD`).
endrequiredstring—Last day shown (`YYYY-MM-DD`).
bucketSvGanttBucket'week'Bar width.
workWeekreadonly number[][1, 2, 3, 4, 5]Working days, 0 = Sunday.
holidaysreadonly GanttChartHoliday[][]Non-working dates.
ariaLabelstring''Accessible name. Defaults to the "Resource load" label.
localestringsvLocale()Locale for dates.
loadingbooleanfalseThe plan or the assignments are still loading: a placeholder instead of the bands, which would otherwise read "nobody is assigned".
errorSvDataError | string | nullnullLoad failure, shown with Try again. A bare string is the message.

Outputs

EventPayload typeDescription
retryvoidTry 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

Pro

Bound to the names this component actually exposes.

Host class

Pro

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.

Loads giscus.app and GitHub — nothing is fetched until you click.