C3 Pie Charts
c3pie.RdDraw an interactive pie chart using 'C3.js'
Usage
c3pie(
x,
labels = names(x),
col = NULL,
slice.text = "pct",
legend.position = "right",
main = NULL,
width = NULL,
height = NULL,
elementId = NULL
)Arguments
- x
a vector of non-negative numerical quantities. The values in x are displayed as the areas of pie slices.
- labels
character vector giving names for the slices.
- col
character vector of colors to be used in filling the slices. Can be a hex value or an R built-in color name.
- slice.text
"pct"to display percentage-formatted values inside pie slices (default c3.js behavior) or"id"to display the slice's name fromlabels(note that this does not change labels' positioning within their slices, so usingslize.text = "id"may result in poorly-placed or cut-off slice labels)- legend.position
Position of the legend. Possible values are
"right","bottom","inset", and"hide".- main
a main title for the plot.
- width
width of the widget to create for the plot. The default is NULL, which results in automatic resizing based on the plot's container.
- height
height of the widget to create for the plot. The default is NULL, which results in automatic resizing based on the plot's container.
- elementId
Use an explicit element ID for the widget, rather than an automatically generated one.