Common options to all cartesian axes. Namespace: options.scales[scaleId]

cjs_scale_category(
  p,
  id,
  type = "category",
  alignToPixels = FALSE,
  backgroundColor = NULL,
  border = cjs_border(),
  display = TRUE,
  grid = cjs_grid(),
  min = NULL,
  max = NULL,
  reverse = FALSE,
  stacked = FALSE,
  suggestedMax = NULL,
  suggestedMin = NULL,
  ticks = cjs_ticks(),
  weight = 0,
  bounds = "ticks",
  position = NULL,
  stack = NULL,
  stackWeight = 1,
  axis = NULL,
  offset = FALSE,
  title.text = "",
  title.display = FALSE,
  title.align = "center",
  title.color = htmlwidgets::JS("Chart.defaults.color"),
  title.font = htmlwidgets::JS("Chart.defaults.font"),
  title.padding = 4,
  labels = NULL
)

Arguments

p

plot

id

axis id

type

string Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart.

alignToPixels

boolean FALSE Align pixel values to device pixels.

backgroundColor

Color Background color of the scale area.

border

object Border configuration. See cjs_border()

display

boolean|string TRUE Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the axis is visible only if at least one associated dataset is visible.

grid

object Grid line configuration. See cjs_grid()

min

number User defined minimum number for the scale, overrides minimum value from data. more...

max

number User defined maximum number for the scale, overrides maximum value from data. more...

reverse

boolean FALSE Reverse the scale.

stacked

boolean|string FALSE Should the data be stacked. more...

suggestedMax

number Adjustment used when calculating the maximum data value. more...

suggestedMin

number Adjustment used when calculating the minimum data value. more...

ticks

object Tick configuration. See cjs_ticks()

weight

number 0 The weight used to sort the axis. Higher weights are further away from the chart area.

bounds

string 'ticks' Determines the scale bounds. more...

position

string | object Position of the axis. more...

stack

string Stack group. Axes at the same position with same stack are stacked.

stackWeight

number 1 Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group.

axis

string Which type of axis this is. Possible values are: 'x', 'y'. If not set, this is inferred from the first character of the ID which should be 'x' or 'y'.

offset

boolean FALSE If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default.

title.text

The text for the title. (i.e. "# of People" or "Response Choices").

title.display

boolean, if title.text is something other than "" then this will be automatically set to TRUE

title.align

Alignment of the axis title. Possible options are 'start', 'center' and 'end'

title.color

color of label, defaults to htmlwidgets::JS('Chart.defaults.color'),

title.font

color of the font, defaults to htmlwidgets::JS('Chart.defaults.font'),

title.padding

Padding to apply around scale labels. Only top, bottom and y are implemented.

labels

labels for the axis

Value

An object of class htmlwidget