For AI agents: the complete documentation index is at llms.txt. Markdown versions are available by appending .md or sending Accept: text/markdown.
Reflex Logo
Docs Logo
Library

/

Graphing

/

General

/

Reference

Reference

The Reference components in Recharts, including ReferenceLine, ReferenceArea, and ReferenceDot, are used to add visual aids and annotations to the chart, helping to highlight specific data points, ranges, or thresholds for better data interpretation and analysis.

Reference Area

The rx.recharts.reference_area component in Recharts is used to highlight a specific area or range on the chart by drawing a rectangular region. It is defined by specifying the coordinates (x1, x2, y1, y2) and can be used to emphasize important data ranges or intervals on the chart.

Reference Line

The rx.recharts.reference_line component in rx.recharts is used to draw a horizontal or vertical line on the chart at a specified position. It helps to highlight important values, thresholds, or ranges on the axis, providing visual reference points for better data interpretation.

Expand

Reference Dot

The rx.recharts.reference_dot component in Recharts is used to mark a specific data point on the chart with a customizable dot. It allows you to highlight important values, outliers, or thresholds by providing a visual reference marker at the specified coordinates (x, y) on the chart.

Expand

API Reference

rx.recharts.ReferenceLine

A ReferenceLine component in Recharts.

Props

PropTypeDescription
x_axis_id
Union[int, str]

The id of x-axis which is corresponding to the data.

y_axis_id
Union[int, str]

The id of y-axis which is corresponding to the data.

if_overflow
"discard""hidden""visible""extendDomain"

Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas.

label
Union[int, str]

If set a string or a number, default label will be drawn, and the option is content.

x
Union[int, str]

If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn.

y
Union[int, str]

If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn.

stroke
Union[str, Color]

The color of the reference line.

stroke_width
Union[str, int, float]

The width of the stroke.

segment
Sequence

Array of endpoints in { x, y } format. These endpoints would be used to draw the ReferenceLine.

Valid Children

Label

rx.recharts.ReferenceDot

A ReferenceDot component in Recharts.

Props

PropTypeDescription
x_axis_id
Union[int, str]

The id of x-axis which is corresponding to the data.

y_axis_id
Union[int, str]

The id of y-axis which is corresponding to the data.

if_overflow
"discard""hidden""visible""extendDomain"

Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas.

label
Union[int, str]

If set a string or a number, default label will be drawn, and the option is content.

x
Union[int, str]

If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn.

y
Union[int, str]

If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn.

r
int

The radius of dot.

fill
Union[str, Color]

The color of the area fill.

stroke
Union[str, Color]

The color of the line stroke.

Valid Children

Label

rx.recharts.ReferenceArea

A ReferenceArea component in Recharts.

Props

PropTypeDescription
stroke
Union[str, Color]

Stroke color.

fill
Union[str, Color]

Fill color.

fill_opacity
float

The opacity of area.

x_axis_id
Union[int, str]

The id of x-axis which is corresponding to the data.

y_axis_id
Union[int, str]

The id of y-axis which is corresponding to the data.

x1
Union[int, str]

A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis.

x2
Union[int, str]

A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis.

y1
Union[int, str]

A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis.

y2
Union[int, str]

A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis.

if_overflow
"discard""hidden""visible""extendDomain"

Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas.

Valid Children

Label
Built with Reflex