Usage
Props
number | string
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.
number | string
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.
number | string
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.
number | string
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.
string
default:"#ccc"
The fill color of the area.
number
default:"0.5"
The opacity of the fill.
string
default:"none"
The stroke color of the area border.
number | string
default:"1"
The width of the stroke.
number
default:"0"
The border radius of the rectangle corners.
boolean | string | number | object | ReactElement | function
default:"false"
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
ReactElement | function
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.
'discard' | 'hidden' | 'visible' | 'extendDomain'
default:"discard"
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
string | number
default:"0"
The id of XAxis which is corresponding to the data. Required when there are multiple XAxes.
string | number
default:"0"
The id of YAxis which is corresponding to the data. Required when there are multiple YAxes.
number
default:"100"
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
string | number
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