Description Usage Arguments Examples
R bindings to the radar plot in the chartJS library
1 2 3 4 5 |
scores |
Data frame or named list of scores for each axis.
If |
labs |
Labels for each axis. If left unspecified labels are taken from the scores data set. If set to NA then labels are left blank. |
width |
Width of output plot |
height |
Height of output plot |
main |
Character: Title to be displayed |
maxScale |
Max value on each axis |
scaleStepWidth |
Spacing between rings on radar |
scaleStartValue |
Value at the centre of the radar |
responsive |
Logical. whether or not the chart should be responsive and resize when the browser does |
labelSize |
Numeric. Point label font size in pixels |
showLegend |
Logical whether to show the legend |
addDots |
Logical. Whether to show a dot for each point |
colMatrix |
Numeric matrix of rgb colour values. If |
polyAlpha |
Alpha value for the fill of polygons |
lineAlpha |
Alpha value for the outlines |
showToolTipLabel |
Logical. If |
... |
Extra options passed straight to chart.js. Names must match existing options http://www.chartjs.org/docs/#getting-started-global-chart-configuration |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Using the data frame interface
chartJSRadar(scores=skills)
# Or using a list interface
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))
# Default settings
chartJSRadar(scores=scores, labs=labs)
# Fix the max score
chartJSRadar(scores=scores, labs=labs, maxScale=10)
# Fix max and spacing
chartJSRadar(scores=scores, labs=labs, maxScale=12, scaleStepWidth = 2)
# Change title and remove legend
chartJSRadar(scores=scores, labs=labs, main = "Data Science Radar", showLegend = FALSE)
# Add pass through settings for extra options
chartJSRadar(scores=scores, labs=labs, maxScale =10, scaleLineWidth=5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.