Usage
Props
string | number | function
required
The key or getter function of a group of data which should be displayed in the funnel.
array
The source data which each element is an object.
string | number | function
default:"name"
Name represents each sector in the tooltip.
This allows you to extract the name from the data:
string: the name of the field in the data objectnumber: the index of the field in the datafunction: a function that receives the data object and returns the name
string
default:"#808080"
The fill color of trapezoids.
string
default:"#fff"
The stroke color of trapezoids.
number | string
The width of the stroke.
ReactElement | function
If set a ReactElement, the shape of funnel can be customized.
If set a function, the function will be called to render customized shape.
ReactElement | function
This component is rendered when this graphical item is activated
(could be by mouse hover, touch, keyboard, programmatically).
boolean | object | ReactElement | function
Renders labels for each trapezoid. Options:
true: renders default labelsfalse: no labels are renderedobject: the props of LabelList componentReactElement: a custom label elementfunction: a render function of custom label
boolean
default:"false"
Hides the whole graphical element when true.Hiding an element is different from removing it from the chart:
Hidden graphical elements are still visible in Legend,
and can be included in axis domain calculations,
depending on
includeHidden props of your XAxis/YAxis.'triangle' | 'rectangle'
default:"triangle"
The shape type of the last trapezoid in the funnel.
boolean
If true, the funnel is rendered upside down.
LegendType
default:"rect"
The type of icon in legend. If set to ‘none’, no legend item will be rendered.
TooltipType
The type of tooltip item.
Animation props
boolean | 'auto'
default:"auto"
If set false, animation of funnel will be disabled.
If set “auto”, the animation will be disabled in SSR and will respect the user’s prefers-reduced-motion system preference for accessibility.
number
default:"400"
Specifies when the animation should begin, the unit of this option is ms.
number
default:"1500"
Specifies the duration of animation, the unit of this option is ms.
AnimationTiming
default:"ease"
The type of easing function.
function
The customized event handler of animation start.
function
The customized event handler of animation end.
Event handlers
function
The customized event handler of click on the area in this group.
function
The customized event handler of mousedown on the area in this group.
function
The customized event handler of mouseup on the area in this group.
function
The customized event handler of mousemove on the area in this group.
function
The customized event handler of mouseover on the area in this group.
function
The customized event handler of mouseout on the area in this group.
function
The customized event handler of mouseenter on the area in this group.
function
The customized event handler of mouseleave on the area in this group.
Layout props
string
Unique identifier of this component.
Used as an HTML attribute
id, and also to identify this element internally.If undefined, Recharts will generate a unique ID automatically.string
CSS class name for styling.
Source
https://github.com/recharts/recharts/blob/main/src/cartesian/Funnel.tsx