Chart

Data Visualization
stable

Universal chart component with 29 visualization primitives (line, area, bar, column, pie, donut, scatter, radar, gauge, pyramid, funnel, honeycomb, treemap, sankey, word-cloud, heatmap, sunburst, box-plot, pictorial, candlestick, streamgraph, variwide, polar-bar, bullet, pareto, map, sparkline, spline, stepped-line). The type prop routes to the appropriate family member.

Structure

Anatomy

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

Anatomy of OrigamChartSchematic of the Chart component with 5 numbered internal parts. Chart Title Legend 1 2 3 4 5 Routes to type-specific family member at runtime (cartesian / polar / radar / gauge / …)
Anatomy of <origam-chart> — 5 visible regions; the component delegates rendering to the appropriate family member based on the type prop.
1.origam-chart
Root element. Delegates to the correct family component (cartesian/polar/radar/gauge/pyramid…).
2.origam-chart__title
Title and subtitle block rendered above the plotting area.
3.origam-chart__axis
X and Y axes with tick labels. Rendered by OrigamChartAxis. Hidden when showAxis=false.
4.origam-chart__legend
Legend block. Rendered by OrigamChartLegend. Position controlled by legendPosition prop.
5.origam-chart__plot
SVG plotting area where series paths, bars or slices are drawn.

API

Props

All props accepted by this component, with their type, default value and description.

type
'line'
Visualization primitive. Accepted values: 'line' | 'area' | 'bar' | 'column' | 'pie' | 'donut' | 'scatter' | 'radar' | 'spline' | 'stepped-line' | 'gauge' | 'pyramid' | 'funnel' | 'honeycomb' | 'treemap' | 'sankey' | 'word-cloud' | 'heatmap' | 'sunburst' | 'box-plot' | 'pictorial' | 'candlestick' | 'streamgraph' | 'variwide' | 'polar-bar' | 'bullet' | 'pareto' | 'map' | 'sparkline'.
series
required
Array<IChartSeries>
[]
Data series array. An empty array renders the #empty slot. Each series contains name, data, color and visible.
categories
Array<string>
[]
X-axis category labels. Length should match the longest series; missing entries fall back to the numeric index.
title
string
Optional title rendered above the plotting area.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
true
Toggle the legend block.
legendPosition
'bottom'
Anchor of the legend block. Accepted: 'top' | 'bottom' | 'left' | 'right'.
showTooltip
boolean
true
Toggle the hover tooltip.
showGrid
boolean
true
Render grid lines behind the plot. Ignored for pie/donut/radar.
showAxis
boolean
true
Render X/Y axes and tick labels. Ignored for pie/donut.
animated
boolean
true
Animate paths/bars/slices on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in ms.
stacked
boolean
false
Stack series on bar/column charts.
stacking
'normal'
Stacking mode when stacked=true. 'normal' = absolute values, 'percent' = 0-100% normalised.
donutHoleSize
number
0.6
Inner-radius proportion for donut type. 0 = pie, 1 = ring of zero thickness. Default 0.6 when type=donut.
Palette cycled when a series has no explicit color. Accepts intent names or raw CSS colours.
xAxisFormat
(value: string | number) => string
Formatter function applied to X-axis tick labels.
yAxisFormat
(value: number) => string
Formatter function applied to Y-axis tick labels.
aspectRatio
string
CSS aspect-ratio shortcut ('16/9', '4/3', '1/1'…). When set, overrides height.
smoothing
'none'
Smoothing strategy for line/area. 'none' = Cartesian segments, 'curve' = cubic Bezier (Catmull-Rom).
yMin
number
Override the auto-computed Y minimum.
yMax
number
Override the auto-computed Y maximum.
gaugeMin
number
0
Lower bound of the gauge range. Ignored unless type=gauge.
gaugeMax
number
100
Upper bound of the gauge range. Ignored unless type=gauge.
gaugeUnit
string
''
Unit suffix appended to the gauge centre label (e.g. "%").
plotBands
Array<IChartPlotBand>
plotLines
Array<IChartPlotLine>
annotations
Array<IChartAnnotation>
drilldown
IChartDrilldownProps
secondaryYAxis
IChartSecondaryYAxis
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
300
Chart height in pixels or a CSS length.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Explicit width override. Defaults to 100% of the container.
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 color of the chart container.

API

Slots

Content slots exposed by this component.

#tooltip
Replace the default tooltip body with a custom component.
#legend-item
Replace one legend entry. Receives series data, its index and current visibility.
#title
Replace the title and subtitle block entirely.
#empty
Rendered when series is empty or every series is hidden.

API

Emits

Events emitted by this component.

@point-click
IChartPoint, MouseEvent | KeyboardEvent
Mouse or keyboard activation on a data point.
@legend-click
IChartSeries, number
Click on a legend entry. Pair with series-toggle to manage visibility state.
@series-toggle
IChartSeries, 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.

Chart container background colour.
Default text colour for title, labels and legend.
Inner padding of the chart container.
Title text colour.
Title font size.
Axis line colour.
Grid line colour.
Tooltip background colour.
Stroke width of line/area series paths.
Animation duration for enter/update transitions.

Inclusion

Accessibility

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

ARIA roles

img
figure

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus to interactive data points (when keyboard navigation is enabled).
Enter / SpaceFires point-click emit on a focused data point.

Notes

  • The animated prop respects prefers-reduced-motion: reduce — set animated=false or let the component detect the system preference.
  • Use colorScheme to provide intent-based colours with sufficient contrast for all colour-vision deficiency profiles. Avoid relying solely on hue to distinguish series — use dashed/solid patterns or labels when possible.
  • The #empty slot provides a meaningful message when no data is available, ensuring screen reader users are not left with a silent chart container.

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.

Source
color
var(--origam-color__surface---default)
Chart container background.
dimension
var(--origam-font__size---lg)
Title font size.
color
var(--origam-color__border---subtle)
Grid line colour.
color
var(--origam-color__surface---inverse)
Tooltip background.
dimension
2px
Line/area stroke width.
duration
600ms
Enter/update animation duration.
dimension
var(--origam-radius---xs)
Bar/column corner radius.
number
0.18
Radar polygon fill opacity.

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.

Line chart

vue

Donut chart

vue

Gauge chart

vue

Ecosystem

Family

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