X axis

Bottom X-axis with evenly spaced tick labels (or explicit positions via tickValues). Renders inside ChartRoot.

Primitive: ChartAxisX

Interactive demo

Usage

import { ChartRoot, ChartAxisX } from '@ramtt/charts'

<ChartRoot data={data} height={200}>
  <ChartAxisX labelCount={6} format={(i) => months[i]} />
</ChartRoot>

Props

PropTypeDefaultDescription
labelCountnumber6Number of evenly-spaced labels
format(index: number, total: number) => stringLabel formatter (default: String(index))
tickValuesnumber[]Explicit data indices for tick positions (overrides labelCount)
dynumber16Vertical offset below chart in px
fontFamilystring'var(--font-sans)'SVG <text> font-family
animateAnimateConfigtrueEntry animation