ChartCartesian

Data Visualization
stable

Cartesian chart engine with X+Y plotting area. Supports line, area, bar, column, scatter, spline and stepped-line topologies. Includes stacking, drilldown, zoom/pan, secondary Y-axis, plot bands, plot lines and annotations.

Structure

Anatomy

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

Anatomy of OrigamChartCartesianSchematic of the cartesian chart component with numbered internal parts. 1 Chart title / subtitle 2 3 4 5 Legend
Anatomy of <origam-chart-cartesian> — 5 internal parts.
1.origam-chart-cartesian__header
Header block. Contains title and subtitle divs.
2.origam-chart-cartesian__body
Body container. Wraps the SVG, drilldown breadcrumb and zoom controls.
3.origam-chart-cartesian__axis
element holding all axis tick labels and grid lines.
4.origam-chart__series
container for series path, area fill, or bar/column rects.
5.origam-chart__legend (via OrigamChartLegend)
Legend list rendered by OrigamChartLegend. grid-area: legend.

API

Props

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

Cartesian visualisation primitive: 'line' | 'area' | 'bar' | 'column' | 'scatter' | 'spline' | 'stepped-line'.
stacked
boolean
false
Stack series on top of each other. Applies to bar, column, and area charts.
stacking
'normal'
Stacking mode: 'normal' (absolute values) or 'percent' (normalised to 100%).
smoothing
'none'
Smoothing strategy for line/area/spline. 'none' for line/area, 'monotone' for spline.
yMin
number
Override the auto-computed Y-axis minimum.
yMax
number
Override the auto-computed Y-axis maximum.
showGrid
boolean
true
Render grid lines behind the plot.
showAxis
boolean
true
Render X and Y axes with tick labels.
showTooltip
boolean
true
Toggle the hover tooltip.
xAxisFormat
(value: string | number) => string
Formatter applied to X-axis tick labels.
yAxisFormat
(value: number) => string
Formatter applied to Y-axis tick labels.
secondaryYAxis
IChartSecondaryYAxis
plotBands
Array<IChartPlotBand>
plotLines
Array<IChartPlotLine>
drilldown
IChartDrilldownProps
zoomable
boolean
false
Enable zoom/pan interactions. Mouse-drag zooms; shift+scroll zooms; ctrl+drag pans. A reset button appears when zoomed.
zoomResetLabel
string
rangeSelector
IChartRangeSelector
annotations
Array<IChartAnnotation>
series
required
Array<IChartSeries>
[]
Data series. Each entry may override type (mix-chart) and yAxis (0=left, 1=right secondary axis).
categories
Array<string>
X-axis labels. Length should match the longest series; missing entries fall back to the numeric index.
title
string
Optional chart 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: top, bottom, left, right.
animated
boolean
true
Animate series on first paint and data changes. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in milliseconds.
Palette used when a series does not pin its own color.
aspectRatio
string
CSS aspect-ratio shortcut (e.g. "16/9"). When set, overrides height.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
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
TColor
fontSize
TFontSize
fontWeight
TFontWeight

API

Slots

Content slots exposed by this component.

#tooltip
Replace the default tooltip body.
#legend-item
Replace one legend entry.
#title
Replace the title block (title + subtitle).
#empty
Rendered when series is empty or has no renderable data.

API

Emits

Events emitted by this component.

@drill
IChartDrilldownLink, IChartPoint
Fired when the user drills into a sub-dataset via a drilldown-linked point.
@drill-up
void
Fired when the user navigates back one drilldown level.
@zoom
{ start: number, end: number }
Fired on every committed zoom. start and end are category indices (inclusive).
@reset-zoom
void
Fired when the user resets the zoom to the full data range.
@point-click
IChartPoint, MouseEvent | KeyboardEvent
Fired on mouse click or keyboard activation on a data point.
@legend-click
IChartSeries, number
Fired when the user clicks a legend entry.
@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 root background colour.
Inner padding of the chart root.
Gap between header, body and legend areas.
Grid line stroke colour.
Tooltip background colour.

Inclusion

Accessibility

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

ARIA roles

figure
img

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus between interactive data points and legend entries.
Enter / SpaceActivates the focused data point and fires point-click.

Notes

  • Root element has role="figure" with aria-label set to the title prop.
  • SVG has role="img" with <title> and <desc> elements.
  • All 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.

Source
color
var(--origam-color__surface---default)
Root chart background.
dimension
var(--origam-space---3)
Chart inner padding.
color
var(--origam-color__border---subtle)
Grid line colour.
color
var(--origam-color__text---secondary)
Axis tick label colour.
color
var(--origam-color__surface---inverse)
Tooltip background.

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

Stacked column chart

vue

Ecosystem

Family

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