alter_axis: Alter a Chart Axis

Description Usage Arguments Value

View source: R/options.R

Description

See here for more detailed documentation: https://www.chartjs.org/docs/latest/axes/.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
alter_axis(
  chart,
  id,
  xOrY = tolower(substr(id, 1, 1)),
  ...,
  position,
  display = TRUE,
  grid = TRUE,
  type = "linear",
  title,
  percent = FALSE,
  decimals = 2L,
  min,
  max,
  suggestedMin,
  suggestedMax
)

Arguments

chart

A chartjs object.

id

The id of the axis to alter (character scalar, should start with "x" or "y").

xOrY

Whether the axis is an x-axis or y-axis object (character scalar, one of c("x", "y"))..

...

Additional named arguments to add to the axis.

position

One of: c("left", "right", "bottom", "top").

display

Whether to display the axis (boolean scalar).

grid

Whether to draw grid lines for the axis (boolean scalar).

type

The type of the axis (should keep as "linear") (character scalar).

title

The title/label of the axis (character scalar).

percent

Whether the axis should be displayed as a percent (boolean scalar).

decimals

The number of decimal places to use for percentage axes (integer scalar).

min, max

The minimum/maximum values to use for the axis (numeric/character scalar).

suggestedMin, suggestedMax

The suggested minimum/maximum values to use for the axis (numeric/character scalar).

Value

A modified chartjs object.


KO112/chartjs documentation built on Aug. 6, 2020, 2:35 p.m.