[Chartjs]-How to Save as png with ChartJSRadar in R?

3👍

library(radarchart)
library(webshot)
library(htmlwidgets)

dat <- data.frame(
  Field = c("Age","Sex","Submission"), 
  y = sample(1:100,3), 
  x = sample(1:100,3)
)

plt <- chartJSRadar(
  scores = dat,
  labelSize= 10, 
  main="Completeness Radar", 
  maxScale = 100
)

saveWidget(plt, "plt.html")

webshot("plt.html")

magick::image_read("webshot.png")

enter image description here

  • radar charts are very difficult for folks to grok
  • data and plot are suberbad variable names
  • whitespace is your bff
  • webshot can limit target area
  • various magick ƒ()s can crop target area
  • consider using http://www.ggplot2-exts.org/ggradar.html

Leave a comment