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

Anatomie

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

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
requis
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

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

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

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.

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

Accessibilité

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

Rôles ARIA

figure
img

Interactions clavier

Interactions clavier
ToucheAction
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.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

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.

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.

Line chart

vue

Stacked column chart

vue

Écosystème

Famille

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