Docs/Cartesian Components/ZAxis

ZAxis

ZAxis is used in ScatterChart to map a third data dimension (typically from a z or size dataKey) to the radius or area of scatter dots, creating bubble charts. The range prop controls the min and max bubble sizes.

import { ScatterChart, Scatter, XAxis, YAxis, ZAxis } from "solid-recharts";

<ScatterChart width={500} height={300} data={data}>
  <XAxis dataKey="x" type="number" />
  <YAxis dataKey="y" type="number" />
  <ZAxis dataKey="z" range={[100, 1000]} />
  <Scatter data={data} fill="#8884d8" />
</ScatterChart>;
ScatterChart
scatter-bubble.tsxOpen ↗
Loading source...

Props

PropTypeDefaultDescription
dataKeystring | function—The key (or accessor function) for the bubble size data
range[number, number]—Min and max radius/area values for scaling bubbles
zAxisIdstring | number0Unique identifier (in case multiple scatter charts exist)
type"number" | "category""number"Data type (always numeric for bubble sizing)
domain[number, number] | functionautoData domain for scaling; auto-detected if omitted
scale"linear" | "log" | …"linear"Scale algorithm for value-to-size mapping
namestring—Axis name (shown in tooltips)
unitstring—Unit label appended to tooltip values

All other recharts ZAxis props are supported; see the recharts ZAxis docs for the complete reference.

Notes

  • ZAxis does not render visual elements; it only registers size configuration for the scatter chart.
  • The range prop is required to size bubbles; without it, all bubbles are the same size.
  • range={[100, 1000]} means the smallest data value maps to radius 100, and the largest to radius 1000.
  • If dataKey is omitted, the ZAxis is ignored and scatter dots use the radius prop.

See also