ChartPictorial
Pictorial / isotype chart where each data value is represented as a column of repeated SVG icons. Supports stack mode (rows of small icons) and fill mode (single large icon clip-masked to the fill ratio).
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-chart-pictorial> — 7 internal parts. The SVG hosts columns ④ containing empty ⑤ and filled ⑥ icon <use> elements plus optional value labels ⑦.- 1.origam-chart-pictorial
- Root wrapper. CSS grid: header / body / legend rows.
- 2.origam-chart-pictorial__header
- Optional title + subtitle block.
- 3.origam-chart-pictorial__body
- Plot area hosting the SVG and the empty slot.
- 4.origam-chart-pictorial__column
- One column per data point. Keyboard-focusable (role="button", tabindex="0").
- 5.origam-chart-pictorial__icon--empty
- Background (unfilled) icon slots filled with emptyIconColor.
- 6.origam-chart-pictorial__icon--filled
- Filled icon slots. In fill mode these use a
for the thermometer effect. - 7.origam-chart-pictorial__value-label
- Formatted value text rendered adjacent to the column when showLabel=true.
API
Props
All props accepted by this component, with their type, default value and description.
- iconstringperson silhouette path
- SVG <path d="…"> string for the icon drawn per slot. Must fit a viewBox="0 0 24 24" coordinate system.
- iconColor
- Colour applied to all filled icons. When omitted, cycles through colorScheme by series index.
- emptyIconColorstring'rgba(0,0,0,0.1)'
- Colour of background (unfilled) icon slots.
- iconsPerUnitnumber1
- How many data units one icon represents. E.g. iconsPerUnit=10 → value 65 renders 7 filled icons (rounded).
- directionTDirection'vertical'
- Icon stacking direction: vertical (bottom-to-top) or horizontal (left-to-right).
- modeTChartPictorialMode'stack'
- Rendering mode. stack = classic isotype (rows of repeated icons). fill = one large icon clip-masked to the fill ratio (thermometer effect).
- showLabelbooleantrue
- Display the raw value label above (vertical) or to the right (horizontal) of each column.
- showAxisbooleantrue
- Display the X-axis category labels below each column.
- xAxisFormat(value: string | number) => string
- Formatter applied to X-axis category labels. Identity by default.
- yAxisFormat(value: number) => string
- Formatter applied to value labels. String(value) by default.
- seriesrequiredArray<IChartSeries>—
- Data series. Each series contains a name and an array of numeric values. Multiple series render side-by-side columns.
- categoriesArray<string>[]
- X-axis category labels, one per data point.
- titlestring
- Optional title rendered above the chart area.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendbooleantrue
- Toggle the legend block.
- legendPositionTChartLegendPosition'bottom'
- Anchor of the legend block: top, bottom, left or right.
- showTooltipbooleantrue
- Toggle the hover tooltip.
- animatedbooleantrue
- Animate icons on first paint. Respects prefers-reduced-motion.
- animationDurationnumber600
- Animation duration in milliseconds.
- Palette cycled by series index when iconColor is not set.
- aspectRatiostring
- CSS aspect-ratio shortcut (e.g. "1/1"). Overrides height when set.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- Chart wrapper height. Accepts CSS length or number (→ px).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColor
- Background colour of the chart wrapper.
- fontSizeTFontSize
- fontWeightTFontWeight
API
Slots
Content slots exposed by this component.
- #tooltip
- Replace the default tooltip card. Receives the hovered point, its series and the category label.
- #empty
- Rendered when series is empty or all series have no data.
- #legend-item
- Replace one legend entry with custom content.
- #title
- Replace the default title + subtitle block.
API
Emits
Events emitted by this component.
- @point-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired on click or keyboard activation (Enter/Space) on a column.
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, boolean
- Resulting visibility flip after a legend click.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Background colour of the chart wrapper.
- Default text colour (inherited by axis labels).
- Inner padding of the root wrapper.
- Grid gap between header / body / legend rows.
- Icon animation duration. Set via animationDuration prop.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between focusable columns (tabindex="0" on each column group). |
| Enter / Space | Activates the focused column (fires point-click). |
Notes
- Root div carries role="figure" and aria-label from the title prop (or "Pictorial chart").
- Inner SVG has role="img" with <title> and <desc> elements summarising series count.
- Each column group has aria-label with category, value and series name.
- All CSS animations are disabled under prefers-reduced-motion: reduce.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorvar(--origam-color__surface---default)
- Chart wrapper background.
- colorvar(--origam-color__surface---inverse)
- Tooltip background colour.
- dimensionvar(--origam-space---3)
- Gap between legend items.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Stack mode — person icons
Fill mode — thermometer effect