geom_bar_interactive

0th

Percentile

add bars with tooltips or click actions

tooltips can be displayed when mouse is over bars, on click actions can be set with javascript instructions.

Usage
geom_bar_interactive(mapping = NULL, data = NULL, stat = "count", position = "stack", ..., width = NULL, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE)
Arguments
mapping
The aesthetic mapping, see geom_point.
data
A data frame, see geom_point.
stat
The statistical transformation to use on the data for this layer, as a string, see geom_point.
position
Postion adjustment, see geom_point.
...
other arguments passed on to layer. See geom_point.
width
Bar width.
na.rm
See geom_point.
show.legend
See geom_point.
inherit.aes
See geom_point.
See Also

ggiraph

Aliases
  • geom_bar_interactive
Examples
g <- ggplot(mpg, aes( x = class, tooltip = class,
        data_id = class ) ) +
  geom_bar_interactive()
ggiraph(code = print(g))

dat <- data.frame( name = c( "David", "Constance", "Leonie" ),
    gender = c( "Male", "Female", "Female" ),
    height = c(172, 159, 71 ) )
g <- ggplot(dat, aes( x = name, y = height, tooltip = gender,
        data_id = name ) ) +
  geom_bar_interactive(stat = "identity")
ggiraph(code = print(g))
Documentation reproduced from package ggiraph, version 0.3.1, License: GPL-3

Community examples

Looks like there are no examples yet.