Renders a scrollbar that allows the user to zoom and pan in the chart along its XAxis.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
The key or getter function of a group of data.
Height of the brush in pixels.
The width of each traveller (the draggable handles on each end).
Custom traveller component. Can be a React element or a render function.
The x-coordinate of brush.
If left undefined, it will be computed from the chart’s offset and margins.
The y-coordinate of brush.
If left undefined, it will be computed from the chart’s offset and margins.
Width of the brush in pixels.
If undefined, defaults to the chart width.
The source data. If not provided, uses data from chart context.
The default start index of brush.
If the option is not set, the start index will be 0.
The default end index of brush.
If the option is not set, the end index will be calculated by the length of data.
Number of data points to skip between chart refreshes.
Padding around the brush content.
The fill color of the brush background.
The stroke color of the brush.
The formatter function of ticks.
Whether to always show the text labels on the travellers.
Time in milliseconds before the brush interaction ends after the mouse leaves.
Aria label for accessibility.
A mini chart element to render inside the brush showing an overview of the data.
Typically a smaller version of the main chart.
Event handlers
The handler of changing the active scope of brush.
The handler called when dragging ends.
CSS class name for styling.
Notes
If a chart is synchronized with other charts using thesyncId prop on the chart,
the brush will also synchronize the zooming and panning between all synchronized charts.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/Brush.tsx