Usage
Props
string | number | function
The key or getter function of a group of data.
number
default:"40"
Height of the brush in pixels.
number
default:"5"
The width of each traveller (the draggable handles on each end).
ReactElement | function
Custom traveller component. Can be a React element or a render function.
number
The x-coordinate of brush.
If left undefined, it will be computed from the chart’s offset and margins.
number
The y-coordinate of brush.
If left undefined, it will be computed from the chart’s offset and margins.
number
Width of the brush in pixels.
If undefined, defaults to the chart width.
array
The source data. If not provided, uses data from chart context.
number
The default start index of brush.
If the option is not set, the start index will be 0.
number
The default end index of brush.
If the option is not set, the end index will be calculated by the length of data.
number
default:"1"
Number of data points to skip between chart refreshes.
object
default:"{top: 1, right: 1, bottom: 1, left: 1}"
Padding around the brush content.
string
default:"#fff"
The fill color of the brush background.
string
default:"#666"
The stroke color of the brush.
function
The formatter function of ticks.
boolean
default:"false"
Whether to always show the text labels on the travellers.
number
default:"1000"
Time in milliseconds before the brush interaction ends after the mouse leaves.
string
Aria label for accessibility.
ReactElement
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
function
The handler of changing the active scope of brush.
function
The handler called when dragging ends.
string
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