Generates a pie chart from an array of data, each datum must have an
id and a value property.
Note that margin object does not take radial labels into account,
so you should adjust it to leave enough room for it.
The responsive alternative of this component is ResponsivePie
.
This component is available in the @nivo/api
, see
sample or
try it using the API client .
You can also see more example usages in
the storybook .
See the dedicated guide on how to setup
legends for this component.
chart code dataroll the dice Start interacting with the chart to log actions
Style
Define style for common elements such as labels, axes… Define patterns and gradients. Define rules to apply patterns and gradients inherit theme custom
inherited property
modifiers
Method to compute border color. Radial labels
Enable/disable radial labels.
Skip label if corresponding slice's angle is lower than provided value. Link offset from pie outer radius, useful to have links overlapping pie slices. X offset from links' end. inherit theme custom
inherited property
modifiers
No modifier.
Defines how to compute radial label link color. Customization
Defines the order of layers and add custom layers. Interactivity
onMouseEnter handler, it receives target node data and mouse event. onMouseMove handler, it receives target node data and mouse event. onMouseLeave handler, it receives target node data and mouse event. onClick handler, it receives target node data and mouse event. Legends
bottom
Defines legend anchor relative to chart's viewport. Legend block x translation. Legend block y translation. Spacing between each item.