RectAreaChart
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.
Usage Example
Props
marks: Array<object> (required)
Each mark defines a rectangular area with the following fields:
-
xStart: numberThe starting X-axis value of the rectangle. -
xEnd: numberThe ending X-axis value of the rectangle. -
yStart: numberThe starting Y-axis value of the rectangle. -
yEnd: numberThe ending Y-axis value of the rectangle.
Optional from ChartMarkProps:
opacity– Controls the transparency of the rectangle.foregroundStyle– Fill color or style of the rectangle.annotation– Optional label or annotation on the mark.
Full Example
This example overlays transparent rectangles centered around each data point, providing a visual range or margin around them.
Use Cases
- Highlight clusters of points or zones on a scatter plot.
- Visualize regions of interest or acceptable ranges.
- Represent uncertainty or tolerance around data values.
