[Chartjs]-Error passing custom options to radarChartJS

1👍

I believe you just need to change your opList argument slightly. chartJSRadar uses ... as a place to pass additional options. In your code, the opList is assumed to be the width argument. Generally, I would say most htmlwidgets put the height and width last so this does not happen, but chartJSRadar does not follow this convention.

This should work, but it doesn’t, so exploring source of the bug. It appears the older version of chartJS on which this is based does not provide title. I added code to show how to manually add a title.

library(radarchart)

labs <- c("Communicator", "Data Wangler", "Programmer",
          "Technologist",  "Modeller", "Visualizer")

scores <- list(
  "Rich" = c(9, 7, 4, 5, 3, 7),
  "Andy" = c(7, 6, 6, 2, 6, 9),
  "Aimee" = c(6, 5, 8, 4, 7, 6)
)


chartJSRadar(
  scores = scores, labs = labs, maxScale = 10,
  title = list(display = TRUE, text = "Custom Title")
)

I quickly hacked together an update you can try with, but it has not been tested and is not ready for pull yet.

devtools::install_github("timelyportfolio/radarchart@update/2.1.6")

Leave a comment