Pie Chart
A Pie Chart in REAVIZ is divided into sectors, each representing a numerical proportion. The arc length of each sector (along with its central angle and area) is proportional to the quantity it represents. Named for its resemblance to a sliced pie, a pie chart effectively visualizes part-to-whole relationships in data.
Types supported by reaviz:
- Pie - A standard pie chart divided into sectors to show proportions.
- Exploded - A variation where one or more slices are separated from the main chart to emphasize specific sectors.
- Donut - Similar to a pie chart, but with a hole in the center, making it easier to read multiple data points.
Where to use:
- Show Proportions: Ideal for visualizing parts of a whole.
- Compare Categories: Useful for comparing different categories in a dataset.
- Highlight Key Data Points: Exploded pie charts emphasize specific sectors.
Quick Start
To create a Pie chart, use import the PieChart and give it data. The chart
will automatically configure itself with the default options exposed via props.
Examples
Pie
Exploded
Donut
API
PieChartΒ
PieArcSeriesΒ
| Name | Type | Default |
|---|---|---|
id | stringUnique id for the series. | |
animated | booleanAnimated set by the | true |
outerRadius | numberOuter radius set by the parent component. | |
innerRadius | numberInner radius set by the parent component. | 0 |
padAngle | numberPad Angle between adjacent arcs, see https://github.com/d3/d3-shape#arc_padAngleΒ | 0 |
padRadius | numberPad Radius between adjacent arcs, see https://github.com/d3/d3-shape#arc_padRadiusΒ | 0 |
cornerRadius | numberCorner Radius of the arcs, see https://github.com/d3/d3-shape#arc_cornerRadiusΒ | 0 |
data | ArcData[]Data set by the parent component. | |
arcWidth | numberWidth of the arc | 0.25 |
doughnut | booleanDoughnut, render as a donut shape | |
explode | booleanExplode: OuterRadius will be adjusted by the data property | false |
displayAllLabels | booleanDisplay all labels shows labels even if there is little space | false |
label | ReactElement<PieArcLabelProps, FC<Partial<PieArcLabelProps>>> | nullLabel component | `<PieArcLabel />` |
arc | ReactElement<PieArcProps, FC<PieArcProps>>Arc Component | `<PieArc />` |
colorScheme | ColorSchemeTypeColor scheme | 'cybertron' |
height | numberHeight set by the parent component | |
width | numberWidth set by the parent component |