ChartCartesian
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.
<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'.
- stackedbooleanfalse
- Stack series on top of each other. Applies to bar, column, and area charts.
- Stacking mode: 'normal' (absolute values) or 'percent' (normalised to 100%).
- Smoothing strategy for line/area/spline. 'none' for line/area, 'monotone' for spline.
- yMinnumber
- Override the auto-computed Y-axis minimum.
- yMaxnumber
- Override the auto-computed Y-axis maximum.
- showGridbooleantrue
- Render grid lines behind the plot.
- showAxisbooleantrue
- Render X and Y axes with tick labels.
- showTooltipbooleantrue
- 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.
- secondaryYAxisIChartSecondaryYAxis
- plotBandsArray<IChartPlotBand>
- plotLinesArray<IChartPlotLine>
- drilldownIChartDrilldownProps
- zoomablebooleanfalse
- Enable zoom/pan interactions. Mouse-drag zooms; shift+scroll zooms; ctrl+drag pans. A reset button appears when zoomed.
- zoomResetLabelstring
- rangeSelectorIChartRangeSelector
- annotationsArray<IChartAnnotation>
- seriesrequiredArray<IChartSeries>[]
- Data series. Each entry may override type (mix-chart) and yAxis (0=left, 1=right secondary axis).
- categoriesArray<string>
- X-axis labels. Length should match the longest series; missing entries fall back to the numeric index.
- titlestring
- Optional chart title rendered above the plotting area.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendbooleantrue
- Toggle the legend block.
- Anchor of the legend block: top, bottom, left, right.
- animatedbooleantrue
- Animate series on first paint and data changes. Respects prefers-reduced-motion.
- animationDurationnumber600
- Animation duration in milliseconds.
- Palette used when a series does not pin its own color.
- aspectRatiostring
- CSS aspect-ratio shortcut (e.g. "16/9"). When set, overrides height.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- 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
- bgColorTColor
- fontSizeTFontSize
- fontWeightTFontWeight
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.
- @drillIChartDrilldownLink, IChartPoint
- Fired when the user drills into a sub-dataset via a drilldown-linked point.
- @drill-upvoid
- 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-zoomvoid
- Fired when the user resets the zoom to the full data range.
- @point-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired on mouse click or keyboard activation on a data point.
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, 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
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between interactive data points and legend entries. |
| Enter / Space | Activates 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.
- colorvar(--origam-color__surface---default)
- Root chart background.
- dimensionvar(--origam-space---3)
- Chart inner padding.
- colorvar(--origam-color__border---subtle)
- Grid line colour.
- colorvar(--origam-color__text---secondary)
- Axis tick label colour.
- colorvar(--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
Stacked column chart
Ecosystem
Family
Components from the same folder that share conventions and often compose together.