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

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

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

All props accepted by this component, with their type, default value and 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
required
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

Content slots exposed by this component.

#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

Events emitted by this component.

@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.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

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

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

figure
img
button

Keyboard interactions

Keyboard interactions
KeyAction
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).

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.

Basic bullet chart

vue

Vertical orientation

vue

Custom colours

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.