e_tooltip {echarts4r} | R Documentation |
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 |
trigger |
What triggers the tooltip, one of |
formatter |
Item and Pointer formatter as returned
by |
... |
Any other option to pass, check See Also section. |
style |
Formatter style, one of |
digits |
Number of decimals. |
locale |
Locale, if |
currency |
Currency to to display. |
Formatters
e_tooltip_pie_formatter
: special helper fore_pie
.e_tooltip_item_formatter
: general helper, this is passed to the tooltipformatter
.e_tooltip_pointer_formatter
: helper for pointer, this is passed to thelabel
parameter underaxisPointer
.
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"
)
)
[Package echarts4r version 0.4.5 Index]