draw_pie | R Documentation |
Draw interactive pie charts using plotly
.
draw_pie(
x,
main = NULL,
xlab = NULL,
ylab = NULL,
col = NULL,
alpha = 0.8,
bg = NULL,
plot_bg = NULL,
theme = choose_theme(),
palette = rtemis_palette,
category_names = NULL,
textinfo = "label+percent",
font_size = 16,
labs_col = NULL,
legend = TRUE,
legend_col = NULL,
sep_col = NULL,
margin = list(b = 50, l = 50, t = 50, r = 20),
padding = 0,
displayModeBar = TRUE,
modeBar_file_format = "svg",
filename = NULL,
file_width = 500,
file_height = 500,
file_scale = 1
)
x |
data.frame: Input: Either a) 1 numeric column with categories defined by rownames, or
b) two columns, the first is category names, the second numeric or c) a numeric vector with categories defined using
the |
main |
Character: Plot title. Default = NULL, which results in |
xlab |
Character: x-axis label. |
ylab |
Character: y-axis label. |
col |
Character: Colors for the pie slices. |
alpha |
Numeric: Alpha for the pie slices. |
bg |
Character: Background color. |
plot_bg |
Character: Plot background color. |
theme |
Theme object. |
palette |
Character: Color palette to use. |
category_names |
Character, vector, length = NROW(x): Category names. Default = NULL, which uses
either |
textinfo |
Character: Info to show over each slice: "label", "percent", "label+percent". |
font_size |
Integer: Font size for labels. |
labs_col |
Character: Color of labels. |
legend |
Logical: If TRUE, show legend. |
legend_col |
Character: Color for legend. |
sep_col |
Character: Separator color. |
margin |
List: Margin settings. |
padding |
Numeric: Padding between cells. |
displayModeBar |
Logical: If TRUE, display the plotly mode bar. |
modeBar_file_format |
Character: File format for image exports from the mode bar. |
filename |
Character: File name to save plot. |
file_width |
Integer: Width for saved file. |
file_height |
Integer: Height for saved file. |
file_scale |
Numeric: Scale for saved file. |
plotly
object.
EDG
## Not run:
draw_pie(VADeaths[, 1, drop = F])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.