Donut chart





A donut or doughnut chart is a ring divided into sectors that each represent a proportion of the whole. It is very close from a pie chart and thus suffers the same problem. In R, it can be built in both ggplot2 and base R.

Note

Donut chart and pie chart are built using similar process in R. Thus, you probably want to visit the pie section for more examples.

Pie chart section



Step by step → the ggplot2 package

There is no specific geom to build donut charts with ggplot2. The trick is to build a stacked barplot and use coord_polar() to make it circular. The following examples will guide you through this process.





Donut chart with base R

It is also possible to build your donut chart without using any library. The example shows how, providing a reusable function that you can quickly apply to your input dataset.





Warning

Piecharts are highly criticized in dataviz. Use it with care, or even better, use alternatives like barcharts, lollipop plots, treemap and others.

What's wrong with it? Barchart Lollipop

Related chart types


Treemap
Doughnut
Pie chart
Dendrogram
Circular packing