Not every X is a timestamp. A load test runs over concurrency levels, a ride over distance. Line, bar and band series plot — and stream — over plain numbers as well as time. For bars over names, see Category bars.
01 — PICK THE AXIS TYPE
axis.x.type is 'time' by default; 'numeric' maps plain numbers. It is read once, when the chart is created — remount the chart (a React key) to switch. For names on X, use 'category': see Category bars.<ChartContainer axis={{ x: { type: 'numeric' } }}>…</ChartContainer>02 — KEY THE POINTS BY X
Points carry
x in place of time. The spacing can be irregular — the line draws at each x and the crosshair snaps to the nearest point. A point whose x doesn't fit the axis is skipped with a dev warning.<LineSeries data={[{ x: 1, value: 120 }, { x: 16, value: 940 }, { x: 64, value: 1235 }]} />03 — FORMAT THE X
<XAxis format> gets the number and formats the tick labels, the crosshair label and the tooltip header. crosshairMove and pointClick report it as x.<XAxis format={(x) => `${Number(x).toFixed(1)} km`} />04 — STREAM IT LIKE TIME
Keep the points in state and pass them to
data. The diff keys on x: a point with a new, larger x is appended with its entrance animation, and .slice(-n) rolls the window while auto-scroll keeps the newest point in view. x must increase from point to point, as time does. Imperatively, appendData and keepLast do the same.setRide((prev) => { const last = prev[prev.length - 1]; return [...prev, { x: last.x + 0.2, value: 284 }].slice(-80);}); <LineSeries data={ride} />