Skip to contents

Y-axis options

Usage

ax_yaxis(
  ax,
  opposite = NULL,
  tickAmount = NULL,
  max = NULL,
  min = NULL,
  floating = NULL,
  labels = NULL,
  axisBorder = NULL,
  axisTicks = NULL,
  title = NULL,
  tooltip = NULL,
  crosshairs = NULL,
  ...
)

Arguments

ax

An apexchart() htmlwidget object.

opposite

Logical. When enabled, will draw the yaxis on the right side of the chart.

tickAmount

Number of Tick Intervals to show.

max

Lowest number to be set for the y-axis. The graph drawing beyond this number will be clipped off.

min

Highest number to be set for the y-axis. The graph drawing beyond this number will be clipped off.

floating

Logical. Floating takes y-axis is taken out of normal flow and places y-axis on svg element directly, similar to an absolutely positioned element. Set the offsetX and offsetY then to adjust the position manually

labels

A list of parameters.

axisBorder

A list of parameters.

axisTicks

A list of parameters.

title

A list of parameters.

tooltip

A list of parameters.

crosshairs

A list of parameters.

...

Additional parameters.

Value

An apexchart() htmlwidget object.

Examples

data("economics_long", package = "ggplot2")
apex(
  data = economics_long,
  mapping = aes(x = date, y = value01, group = variable),
  type = "line"
) %>%
  ax_yaxis(
    decimalsInFloat = 2, title = list(text = "Rescaled to [0,1]")
  )
# Format tick labels temperature <- data.frame( month = head(month.name), tp = c(4, -2, 2, 7, 11, 14) ) apex(temperature, aes(month, tp), "line") %>% ax_yaxis( labels = list( formatter = htmlwidgets::JS("function(value) {return value + '\u00b0C';}") ) )