Skip to contents

Creates sunburst (hierarchical ring) charts using plotly for visualizing hierarchical/nested data as concentric rings.

Usage

SunburstPlot(
  data,
  labels,
  parents,
  values,
  color_name = NULL,
  palette = "forge",
  palcolor = NULL,
  title = NULL,
  width = NULL,
  height = NULL,
  seed = 8525,
  ...
)

Arguments

data

A data frame containing the data to plot

labels

Column for segment labels.

parents

Column for parent labels (defines hierarchy).

values

Column for segment values.

color_name

Legend title.

palette

Color palette name

palcolor

Custom colors for palette

title

Plot title

width, height

Plot dimensions in pixels.

seed

Random seed for reproducibility

...

Additional arguments.

Value

A plotly object

Examples

# \donttest{
data <- data.frame(
  labels = c("Total", "A", "B", "A1", "A2", "B1", "B2"),
  parents = c("", "Total", "Total", "A", "A", "B", "B"),
  values = c(100, 60, 40, 35, 25, 22, 18)
)
SunburstPlot(data, labels = "labels", parents = "parents", values = "values")
# }