Moves, titles, or removes the key naming a chart's groups. A legend needs
something to name, so a chart only has one once set_color() has grouped
it, and it is drawn by default from then on. A heat chart is the
exception: its legend is the colour gradient, so it always has one.
Details
Asking for a legend on a chart that cannot show one is an error rather
than a silent no-op - visible = TRUE cannot conjure a key out of a
single series.
Examples
df <- data.frame(
species = c("a", "a", "b"),
island = c("x", "y", "x")
)
arc_bar(df, species) |>
set_color(island) |>
set_legend(position = "bottom", title = "Island")