chartJSRadar: Make a ChartJS Radar Plot

Description Usage Arguments Examples

View source: R/chartJSRadar.R

Description

R bindings to the radar plot in the chartJS library.

Usage

1
2
3
4
chartJSRadar(scores, labs, width = NULL, height = NULL, maxScale = NULL,
  scaleStepWidth = NULL, scaleStartValue = 0, responsive = TRUE,
  labelSize = 18, addDots = TRUE, colMatrix = diag(3) * 255,
  polyAlpha = 0.2, lineAlpha = 0.8, ...)

Arguments

scores

Named list of scores for each axis

labs

Labels for each axis

width

Width of output plot

height

Height of output plot

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

addDots

Logical. Whether to show a dot for each point

colMatrix

Numeric matrix of rgb colour values

polyAlpha

Alpha value for the fill of polygons

lineAlpha

Alpha value for the outlines

...

Extra options passed straight to chart.js

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

# Add pass through settings for extra options
chartJSRadar(scores=scores, labs=labs, maxScale =10, scaleLineWidth=5)

shaneporter/radarchart documentation built on May 29, 2019, 8:07 p.m.