ax_tooltip: Tooltip options

Description Usage Arguments Value Note Examples

View source: R/apex-utils.R

Description

Tooltip options

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
ax_tooltip(
  ax,
  enabled = NULL,
  shared = NULL,
  followCursor = NULL,
  intersect = NULL,
  inverseOrder = NULL,
  custom = NULL,
  fillSeriesColor = NULL,
  onDatasetHover = NULL,
  theme = NULL,
  x = NULL,
  y = NULL,
  z = NULL,
  marker = NULL,
  items = NULL,
  fixed = NULL,
  ...
)

Arguments

ax

A apexcharts htmlwidget object.

enabled

Logical. Show tooltip when user hovers over chart area.

shared

Logical. When having multiple series, show a shared tooltip.

followCursor

Logical. Follow user's cursor position instead of putting tooltip on actual data points.

intersect

Logical. Show tooltip only when user hovers exactly over datapoint.

inverseOrder

Logical. In multiple series, when having shared tooltip, inverse the order of series (for better comparison in stacked charts).

custom

JS function. Draw a custom html tooltip instead of the default one based on the values provided in the function arguments.

fillSeriesColor

Logical. When enabled, fill the tooltip background with the corresponding series color.

onDatasetHover

A list of parameters.

theme

A list of parameters.

x

A list of parameters.

y

A list of parameters.

z

A list of parameters.

marker

A list of parameters.

items

A list of parameters.

fixed

A list of parameters.

...

Additional parameters.

Value

A apexcharts htmlwidget object.

Note

See https://apexcharts.com/docs/options/tooltip/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data("mpg", package = "ggplot2")

# Hide tooltip
apex(
  data = mpg,
  mapping = aes(x = manufacturer, fill = year)
) %>% 
  ax_tooltip(enabled = FALSE)

# Share between series
apex(
  data = mpg,
  mapping = aes(x = manufacturer, fill = year)
) %>% 
  ax_tooltip(shared = TRUE)

# Fixed tooltip
data("economics", package = "ggplot2")
apex(
  data = economics,
  mapping = aes(x = date, y = psavert),
  type = "line"
) %>% 
  ax_tooltip(
    fixed = list(enabled = TRUE, position = "topLeft")
  )

Example output



apexcharter documentation built on May 11, 2021, 5:05 p.m.