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
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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.
- seriesrequisArray<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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---default)
- Chart wrapper background.
- colorvar(--origam-color__surface---inverse)
- Tooltip background colour.
- dimensionvar(--origam-space---3)
- Gap between legend items.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Stack mode — person icons
Fill mode — thermometer effect