Renders a line or area curve with various interpolation types. The Curve component is used internally by Line and Area charts to render the data paths. It supports multiple interpolation algorithms from D3 and can render both simple lines and filled areas.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/recharts/recharts/llms.txt
Use this file to discover all available pages before exploring further.
Props
Data
The coordinates of all the points in the curve, as an array of objects with x and y coordinates.
Baseline of the area:
- If a number: uses the corresponding axis value as a flat baseline
- If an array of coordinates: describes a custom baseline path
Interpolation
The interpolation type of curve. Can be:
'basis'- B-spline interpolation'basisClosed'- Closed B-spline'basisOpen'- Open B-spline'bumpX'- Bump curve with horizontal segments'bumpY'- Bump curve with vertical segments'bump'- Bump curve (uses layout to determine direction)'linear'- Piecewise linear segments'linearClosed'- Closed linear path'natural'- Natural cubic spline'monotoneX'- Cubic spline that preserves monotonicity in x'monotoneY'- Cubic spline that preserves monotonicity in y'monotone'- Monotone cubic spline (uses layout to determine direction)'step'- Step function'stepBefore'- Step function with vertical segment before horizontal'stepAfter'- Step function with vertical segment after horizontal- Custom function: a D3 curve factory function
This option affects the interpolation algorithm when the type prop is set to ‘monotone’ or ‘bump’.
It also specifies the type of baseline when the curve is closed.
Whether to connect the curve across null points.When
false, gaps appear in the curve where data points are null.
When true, the curve connects across null values.See examples:Appearance
CSS class name to apply to the curve element.
The pattern of dashes and gaps used to paint the line.Examples:
"5 5"- 5px dashes with 5px gaps"10 5 2 5"- More complex pattern10- Single number interpreted as “10 10”
A pre-computed SVG path string. If provided, this is used instead of computing the path from points.
React ref to access the underlying SVG path element.
SVG properties
This component accepts all standard SVG path element properties including:fill- Fill colorstroke- Stroke colorstrokeWidth- Stroke widthopacity- Opacity valuestyle- Inline styles
Events
Event handler for click events on the curve.
Event handler for mouseenter events on the curve.
Event handler for mouseleave events on the curve.
Event handler for mousedown events on the curve.
Event handler for mouseup events on the curve.
Event handler for mousemove events on the curve.
Event handler for mouseover events on the curve.
Event handler for mouseout events on the curve.