donut_chart: Creates a donut chart.

Description Usage Arguments Examples

View source: R/donut.R

Description

Creates a donut chart.

Usage

1
2
3
4
5
donut_chart(data, groupColumn, totalsColumn, centerLabel = "",
  centerColor = "#767676", centerLabelColor = "white",
  centerLabelSize = 24, startColor = "#00c896", endColor = "#678fdc",
  outerLabelColor = "black", outerLabelSize = 10,
  includePercentage = T, percentOnSeparateLine = T, ...)

Arguments

data

The data set.

groupColumn

The column with the categorical labels.

totalsColumn

The column with the categorical totals.

centerLabel

A character vector. The label displayed in the center of the donut.

centerColor

A character vector. The color of the donut's center.

centerLabelColor

A character vector. The font color of the donut's center label.

centerLabelSize

An integer. The font (point) size of the donut's center label.

startColor

The starting color of the range of colors used for the slices.

endColor

A character vector. The ending color of the range of colors used for the slices.

outerLabelColor

A character vector. The font color of the outer labels.

outerLabelSize

An integer. The font (point) size of the outer labels.

includePercentage

A logical. Whether to include percentages next to the slices.

percentOnSeparateLine

A logical. Whether the percent label for each slice should be on a separate line (below the label). includePercentage must be TRUE to take effect.

...

Additional arguments to pass to geom_text_repel (controls the slice labels).

Examples

1
2
as_tibble(Titanic) %>% count(Class, wt=n) %>% rename(PassengersCount=nn) %>%
  donut_chart(Class, PassengersCount, "Class")

Blake-Eryx/donutchart documentation built on July 24, 2021, 6:41 a.m.