Pie | R Documentation |
Pie chart
Pie(
x,
type = "Pie",
colors = NULL,
pie.subslice.colors = NULL,
pie.subslice.colors.repeat = TRUE,
global.font.family = "Arial",
global.font.color = rgb(44, 44, 44, maxColorValue = 255),
title = "",
title.font.family = global.font.family,
title.font.size = 16,
title.font.color = global.font.color,
subtitle = "",
subtitle.font.family = global.font.family,
subtitle.font.size = 12,
subtitle.font.color = global.font.color,
footer = "",
footer.font.family = global.font.family,
footer.font.size = 8,
footer.font.color = global.font.color,
footer.wrap = TRUE,
footer.wrap.nchar = 100,
pie.data.threshold = NULL,
pie.values.order = "initial",
data.label.format = "",
data.label.prefix = "",
data.label.suffix = "",
data.label.font.size = 10,
data.label.font.color = global.font.color,
data.label.font.family = global.font.family,
hovertext.font.family = global.font.family,
hovertext.font.size = 10,
hovertext.font.color = NULL,
hovertext.bg.color = NULL,
hovertext.bg.opacity = 0.8,
pie.groups.font.size = data.label.font.size,
pie.groups.font.color = data.label.font.color,
pie.groups.font.family = data.label.font.family,
pie.groups.order = "initial",
pie.inner.radius = NULL,
pie.border.color = rgb(255, 255, 255, maxColorValue = 255)
)
x |
Input data in the form of a vector, matrix or dataframe. If a dataframe is given, the first column is expected to contain the label names, the second column contains numeric values and the third (optional) column are the group labels. |
type |
One of "Pie" or "Donut" |
colors |
Character; a vector containing one or more colors specified as hex codes. |
pie.subslice.colors |
A vector containing hex value colors for the outer ring of the pie chart. If not supplied will default to the same colors as the inner ring. |
pie.subslice.colors.repeat |
Logical; if, when a grouped pie chart is displayed, the colors of the subslices should repeat by group, or be different throughout; defaults to TRUE. |
global.font.family |
Character; font family for all occurrences of any font attribute for the chart unless specified individually. |
global.font.color |
Global font color as a named color in character format (e.g. "black") or an a hex code. |
title |
Character; chart title. |
title.font.family |
Character; title font family. Can be "Arial Black", "Arial", "Comic Sans MS", "Courier New", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", "Marlett", "Symbol", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana", "Webdings" |
title.font.size |
Integer; Title font size; default = 10. |
title.font.color |
Title font color as a named color in character format (e.g. "black") or a hex code. |
subtitle |
Character |
subtitle.font.family |
Character; subtitle font family |
subtitle.font.size |
Integer; subtitle font size |
subtitle.font.color |
subtitle font color as a named color in character format (e.g. "black") or an a hex code. |
footer |
Character |
footer.font.family |
Character; footer font family |
footer.font.size |
Integer; footer font size |
footer.font.color |
footer font color as a named color in character format (e.g. "black") or an a hex code. |
footer.wrap |
Logical; whether the footer text should be wrapped. |
footer.wrap.nchar |
Number of characters (approximately) in each
line of the footer when |
pie.data.threshold |
Labels with values smaller than the theshold are not shown. |
pie.values.order |
Order of the labels shown. Can be one of 'descending', 'alphabetical' or 'initial'. |
data.label.format |
A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers |
data.label.prefix |
Character; prefix for data values. |
data.label.suffix |
Character; suffix for data values. |
data.label.font.size |
Integer; Font size for data label.px. |
data.label.font.color |
Font color as a named color in character format (e.g. "black") or an a hex code. This can be a single color, a vector of colors (1 for each series/column), or a comma separated list of colors |
data.label.font.family |
Character; font family for data label. |
hovertext.font.family |
Font family of hover text. |
hovertext.font.size |
Font size of hover text. |
hovertext.font.color |
Font color of hover text. If |
hovertext.bg.color |
Color of the hover text background. If |
hovertext.bg.opacity |
Opacity of the hover text background. |
pie.groups.font.size |
Font size for group labels. |
pie.groups.font.color |
Font color as a named color |
pie.groups.font.family |
Character; font family for group labels. |
pie.groups.order |
Order of the groups shown. Can be one of 'descending', 'alphabetical' or 'initial'. |
pie.inner.radius |
The size of the inner radius of pie and donut charts as a proportion out of 100. Defaults to 70. |
pie.border.color |
A single color for space around pie and between segments. |
dat <- data.frame(labels=rep(LETTERS[24:26], each=3), vals=abs(rnorm(9)),
groups=rep(LETTERS[1:3], 3), stringsAsFactors = FALSE)
Pie(dat)
Pie(dat, pie.subslice.colors=rainbow(9), pie.subslice.colors.repeat = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.