Add a dataset to a chartjs instance

cjs_add_doughnut_pie(
  p,
  type = c("doughnut", "pie"),
  ...,
  label = NULL,
  data = NULL
)

Arguments

p

a chartjs htmlwidget

type

which of doughnut', 'pie' wanted

...

aesthetic parameters to pass on to chartjs chart types e.g. x, y, colors, TODO, ...

label

dataset title (used in legends)

data

data from which aesthetic parameters are sourced. If NULL, that within the chartjs htmlwidget is used.

Value

An object of class htmlwidget