Draws a rectangular area on the chart to highlight a specific range.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.
Usage
Props
Starting X-coordinate of the area.
This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceArea will internally calculate the correct pixel position.If undefined then the area will extend to the left edge of the chart plot area.
Ending X-coordinate of the area.
This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceArea will internally calculate the correct pixel position.If undefined then the area will extend to the right edge of the chart plot area.
Starting Y-coordinate of the area.
This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceArea will internally calculate the correct pixel position.If undefined then the area will extend to the top edge of the chart plot area.
Ending Y-coordinate of the area.
This value is using your chart’s domain, so you will provide a data value instead of a pixel value.
ReferenceArea will internally calculate the correct pixel position.If undefined then the area will extend to the bottom edge of the chart plot area.
The fill color of the area.
The opacity of the fill.
The stroke color of the area border.
The width of the stroke.
The border radius of the rectangle corners.
Renders a single label.
false: no labels are renderedstring|number: the content of the labelobject: the props of LabelList componentReactElement: a custom label elementfunction: a render function of custom label
If set a ReactElement, the shape of the reference area can be customized.
If set a function, the function will be called to render customized shape.
Defines how to draw the reference area if it falls outside the chart area.
discard: don’t render if outsidehidden: render but clip to chart areavisible: render even if outsideextendDomain: extend the axis domain to include the reference area
The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.
The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.
Z-Index of this component and its children. The higher the value,
the more on top it will be rendered.
Components with higher zIndex will appear in front of components with lower zIndex.
If undefined or 0, the content is rendered in the default layer without portals.@since 3.4
CSS class name for styling.
Notes
This component, unlike Rectangle or<rect>, is aware of the cartesian coordinate system,
so you specify the area by using data coordinates instead of pixels.
ReferenceArea will calculate the pixels based on the provided data coordinates.
If you prefer to render rectangles using pixels rather than data coordinates,
consider using the Rectangle component instead.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/ReferenceArea.tsx