I'm using the C3 package and trying to make a pie chart that replicates the one found on the c3js.org website (https://c3js.org/samples/chart_pie.html).
The examples for the C3 package and on the c3js.org show something like the code below as working. Mine doesn't. Any ideas about what I need to do to replicate the behavior of the c3js.org example? I want the tooltip to pop up onclick, along with the change in colors of the pie slices. This feels like I am missing something very simple.
library(c3)
data.frame(sugar = 20,
fat = 45,
salt = 10) %>%
c3(onclick = htmlwidgets::JS('function (d, i) { console.log("onclick", d, i)}')) %>%
c3_pie()