Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

e-tooltip

Tooltip


Description

Customise tooltip

Usage

e_tooltip(e, trigger = c("item", "axis"), formatter = NULL, ...)

e_tooltip_item_formatter(
  style = c("decimal", "percent", "currency"),
  digits = 0,
  locale = NULL,
  currency = "USD"
)

e_tooltip_choro_formatter(
  style = c("decimal", "percent", "currency"),
  digits = 0,
  locale = NULL,
  currency = "USD"
)

e_tooltip_pie_formatter(
  style = c("decimal", "percent", "currency"),
  digits = 0,
  locale = NULL,
  currency = "USD",
  ...
)

e_tooltip_pointer_formatter(
  style = c("decimal", "percent", "currency"),
  digits = 0,
  locale = NULL,
  currency = "USD"
)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

trigger

What triggers the tooltip, one of item or item.

formatter

Item and Pointer formatter as returned by e_tooltip_item_formatter, e_tooltip_pointer_formatter, e_tooltip_pie_formatter.

...

Any other option to pass, check See Also section.

style

Formatter style, one of decimal, percent, or currency.

digits

Number of decimals.

locale

Locale, if NULL then it is inferred from Sys.getlocale.

currency

Currency to to display.

Formatters

See Also

Examples

# basic
USArrests %>%
  e_charts(Assault) %>%
  e_scatter(Murder) %>%
  e_tooltip()

# formatter
cars %>%
  dplyr::mutate(
    dist = dist / 120
  ) %>%
  e_charts(speed) %>%
  e_scatter(dist, symbol_size = 5) %>%
  e_tooltip(
    formatter = e_tooltip_item_formatter("percent")
  )

# axis pointer
cars %>%
  e_charts(speed) %>%
  e_scatter(dist, symbol_size = 5) %>%
  e_tooltip(
    formatter = e_tooltip_pointer_formatter("currency"),
    axisPointer = list(
      type = "cross"
    )
  )

echarts4r

Create Interactive Graphs with 'Echarts JavaScript' Version 5

v0.4.0
Apache License (>= 2.0)
Authors
John Coene [aut, cre, cph], Wei Su [ctb], Helgasoft [ctb], Xianying Tan [ctb] (<https://orcid.org/0000-0002-6072-3521>)
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.