ChartAxis

Data Visualization
stable

Axis and tick rendering sub-component. Extracts cartesian axis chrome (X+Y axes, grid lines, tick labels) from the chart family so polar/radar/gauge families do not inherit cartesian elements.

Structure

Anatomie

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

Anatomy of OrigamChartAxisSchematic showing X axis, Y axis, grid lines and tick labels. 300 200 100 Jan Feb Mar 1 2 3 4
Anatomy of <origam-chart-axis> — 4 visible regions: Y axis line ①, X axis line ②, horizontal grid lines ③, and tick labels ④.
1.origam-chart-axis__y-axis
Left vertical axis line. Hidden when showAxis=false.
2.origam-chart-axis__x-axis
Bottom horizontal axis line. Hidden when showAxis=false.
3.origam-chart-axis__grid
Horizontal grid lines aligned with Y-axis ticks. Hidden when showGrid=false.
4.origam-chart-axis__tick-label
X and Y axis tick labels formatted by xAxisFormat / yAxisFormat.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

plot
requis
{ x0: number y0: number x1: number y1: number cx: number cy: number }
Pixel coordinates of the plotting area's four corners plus centre. Comes verbatim from useChart().plot.value.
ticks
requis
{ x: Array<IChartTick> y: Array<IChartTick> }
Tick descriptors for X and Y (primary left axis). Comes from useChart().ticks.value.
secondaryYTicks
Array<IChartTick>
Tick descriptors for the secondary right Y axis. When provided, a second vertical axis is rendered on the right edge of the plot area.
showAxis
boolean
true
Render the four-corner axis frame and tick labels. When false, the component renders nothing.
showGrid
boolean
true
Render horizontal grid lines under the plot area.
xAxisFormat
(value: string | number) => string
Formatter applied to X-axis tick labels. Defaults to String(value).
yAxisFormat
(value: number) => string
Formatter applied to Y-axis tick labels. Defaults to String(value).
secondaryYAxisFormat
(value: number) => string
Formatter applied to the secondary (right) Y-axis tick labels. Falls back to yAxisFormat, then String(value).

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.

Axis line colour.
Tick label text colour.
Tick label font size.
Grid line colour.
Grid line stroke width.

Inclusion

Accessibilité

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

Rôles ARIA

group

Notes

  • ChartAxis is a purely decorative SVG sub-component with no interactive elements. Accessibility is handled by the parent chart container (role="img" with aria-label describing the data).

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__border---default)
Axis line colour.
color
var(--origam-color__text---secondary)
Tick label text colour.
color
var(--origam-color__border---subtle)
Grid line colour.
dimension
1px
Grid line stroke width.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Sous-partie interne : elle est injectée par son composant parent et ne peut pas se rendre seule. Voir la fiche du composant parent pour un exemple vivant.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Usage inside OrigamChartCartesian

vue

Écosystème

Famille

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