Docs/Cartesian Components/Scatter

Scatter

Scatter is a graphical series component that renders points on a cartesian chart, typically for scatter plots and bubble charts. Points can be sized by a Z-axis value and optionally connected with a line.

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

<ScatterChart width={500} height={300} data={data}>
  <CartesianGrid strokeDasharray="3 3" />
  <XAxis dataKey="x" />
  <YAxis dataKey="y" />
  <Tooltip />
  <Scatter name="Series A" dataKey="y" fill="#8884d8" />
</ScatterChart>;
ScatterChart
scatter-bubble.tsxOpen ↗
Loading source...

Props

PropTypeDefaultDescription
dataKeystring | number | func—Y-axis data key or accessor (X from XAxis.dataKey)
xAxisIdnumber | string0X-axis id to bind to
yAxisIdnumber | string0Y-axis id to bind to
zAxisIdnumber | string0Z-axis id for point size
fillstring"#808080"Point fill color
shapestring | function"circle"Symbol type or custom render function
lineboolean | object | functionfalseRender a connecting line through points
lineType"fitting" | "joint""joint"Line computation: regression line or connect-all
lineJointTypestring"linear"Curve interpolation for the joint line
isAnimationActiveboolean | "auto""auto"Enable enter/update animation
labelboolean | objectfalseRender labels at each point

See the recharts Scatter docs for the full prop matrix.

Notes

  • XAxis/YAxis data: Scatter uses the chart's XAxis/YAxis dataKey props to locate x and y values; if either axis has no dataKey, Scatter's dataKey is used for that axis.
  • Z-axis sizing: if the chart has a ZAxis, its dataKey scales point size (larger Z → larger bubble); omit ZAxis for uniform-sized points.
  • Connecting lines: set line={true} to draw a line through the points; lineType="fitting" fits a linear regression instead of connecting all points.
  • Custom symbols: pass built-in types ("circle", "cross", "diamond", etc.) or a function render prop that returns custom SVG.

See also