Skip to contents

Chart's subtitle

Usage

ax_subtitle(
  ax,
  text = NULL,
  align = NULL,
  margin = NULL,
  offsetX = NULL,
  offsetY = NULL,
  floating = NULL,
  style = NULL,
  ...
)

Arguments

ax

An apexchart() htmlwidget object.

text

Text to display as a subtitle of chart.

align

Alignment of subtitle relative to chart area. Possible Options: "left", "center" and "right".

margin

Numeric. Vertical spacing around the subtitle text.

offsetX

Numeric. Sets the left offset for subtitle text.

offsetY

Numeric. Sets the top offset for subtitle text

floating

Logical. The floating option will take out the subtitle text from the chart area and make it float on top of the chart.

style

List with two items: fontSize (Font Size of the subtitle text) and color (Fore color of the subtitle text).

...

Additional parameters.

Value

An apexchart() htmlwidget object.

Examples

data("economics", package = "ggplot2")
apex(
  data = economics,
  mapping = aes(x = date, y = uempmed),
  type = "line"
) %>%
  ax_title(
    text = "Median duration of unemployment"
  ) %>%
  ax_subtitle(
    text = "in weeks"
  )