ChartBullet

Data Display
stable

Bullet chart (Stephen Few design) — compact KPI display combining qualitative range bands, an actual-value bar, and a target marker tick. Supports horizontal and vertical orientations.

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamChartBulletSchematic of the ChartBullet component with 6 numbered internal parts. __header (title + subtitle) Revenue Profit 0 100 200 300 1 2 3 4 5 6 ② range bands stack left→right; ③ bar overlaid; ④ target tick; ⑤ axis
Anatomy of <origam-chart-bullet> — 6 internal parts. Each bullet row contains stacked qualitative range bands, an actual-value bar, and a target tick.
1.origam-chart-bullet
Root element. CSS grid with areas: header / body / legend. role="figure" + aria-label from title.
2.origam-chart__bullet-range
SVG for each qualitative range band. Fill driven by rangeColors palette or per-range color.
3.origam-chart__bullet-bar
SVG for the actual-value bar. tabindex="0" and role="button" — keyboard activatable.
4.origam-chart__bullet-target
SVG representing the target/goal tick. stroke-linecap: round.
5.origam-chart__bullet-axis-line
SVG axis baseline and tick labels. Visible when showAxis=true.
6.origam-chart-bullet__header
Title + subtitle block. Grid area: header. Rendered only when title or subtitle is provided.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

categories
Array<string>
[]
Category labels, one per series entry. Falls back to series[i].name when omitted.
barColor
'primary'
Fill colour for the actual-value bar. Accepts a TIntent token or a raw CSS colour.
targetColor
'danger'
Stroke colour for the target marker tick.
rangeColors
Array<TIntent | string>
['danger','warning','success']
Fallback palette cycled across range bands when range.color is omitted.
orientation
TDirection
'horizontal'
Layout direction. 'horizontal' renders bullets as rows; 'vertical' renders them as columns.
barThickness
number
0.45
Thickness of the actual-value bar as a fraction of the slot height [0, 1].
showAxis
boolean
true
Renders the quantitative axis ticks and baseline.
xAxisFormat
(value: string | number) => string
X-axis tick label formatter.
yAxisFormat
(value: number) => string
Y-axis tick label formatter (vertical orientation).
series
requis
Array<IChartSeries>
—
Data series — one entry per bullet row. Each series.data[0] must be an IChartBulletDatum with value, target and ranges.
title
string
Optional chart title rendered above the plotting area.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
false
Renders a ChartLegend listing each bullet entry.
legendPosition
TChartLegendPosition
'bottom'
Position of the legend block: 'top' | 'bottom' | 'left' | 'right'.
showTooltip
boolean
true
Shows a tooltip on hover/focus with value, target and achievement percentage.
animated
boolean
true
Fades bars in on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in ms.
colorScheme
Array<TIntent | string>
aspectRatio
string
CSS aspect-ratio shortcut. When set, overrides height and lets the chart breathe with the container width.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
280
Component height. Accepts a CSS length or a number (converted to px).
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
bgColor
Background colour applied to the chart root.
fontSize
TFontSize
fontWeight
TFontWeight

API

Slots

Emplacements de contenu exposés par ce composant.

#tooltip
Replaces the default tooltip body. Receives the hovered bullet descriptor plus delta % (value / target × 100).
#legend-item
Replaces one legend entry with custom markup.
#title
Replaces the default title/subtitle block.
#empty
Shown when series is empty or every bullet is hidden.

API

Emits

Événements émis par ce composant.

@point-click
IChartPoint, MouseEvent | KeyboardEvent
Fired when the user clicks or keyboard-activates a bullet bar.
@legend-click
IChartSeries, number
Fired when the user clicks a legend entry.
@series-toggle
IChartSeries, boolean
Fired after a legend click with the intended next visibility value.

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.

Gap between header, body and legend areas.
Internal padding of the chart root.
Background colour of the chart root.
Entry animation duration. Driven by the animationDuration prop.
Opacity of range band rects.
Stroke width of the target marker tick.
Fill colour of axis labels and category labels.
Font size of axis labels.
Font size of the chart title.
Font weight of the chart title.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

figure
img
button

Interactions clavier

Interactions clavier
ToucheAction
TabMoves focus through each bullet bar (tabindex="0") and legend items.
Enter / SpaceActivates the focused bullet bar, firing the point-click emit.

Notes

  • Root has role="figure" with aria-label from the title prop (falls back to "bullet chart").
  • The SVG carries role="img" with a <title> and <desc> for screen readers.
  • Each bullet bar has aria-label describing category, value, target and achievement percentage.
  • Entry animations are disabled via @media (prefers-reduced-motion: reduce).

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.

Basic bullet chart

vue

Vertical orientation

vue

Custom colours

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.