Draw an interactive pie chart using 'Chart.js'
Usage
plotjspie(
x,
labels = names(x),
col = NULL,
slice.text = "pct",
donut = FALSE,
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 or"id"to display the slice's name fromlabels.- donut
logical; should the chart be rendered as a donut chart instead of a full pie?
- 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.