The RectAreaChart
component renders rectangular areas over a 2D chart coordinate space. It is useful for highlighting regions, data clusters, or ranges of interest on a chart. You can combine it with other charts like PointChart
for layered visualizations.
marks: Array<object>
(required)Each mark
defines a rectangular area with the following fields:
xStart: number
The starting X-axis value of the rectangle.
xEnd: number
The ending X-axis value of the rectangle.
yStart: number
The starting Y-axis value of the rectangle.
yEnd: number
The ending Y-axis value of the rectangle.
ChartMarkProps
:opacity
– Controls the transparency of the rectangle.foregroundStyle
– Fill color or style of the rectangle.annotation
– Optional label or annotation on the mark.This example overlays transparent rectangles centered around each data point, providing a visual range or margin around them.