You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling ggplotly on ggplot invoking geom_area results in a plot in which the tooltip activates when hovering over the "lines" separating the areas. I would have expected the tooltip to activate when hovered over the filled area.
Here is some reprex
library("ggplot2")
library("plotly")
#create the datadata<-data.frame('year'= rep(1981:2020, 2),
"type"= rep(c("a", "b"), 40),
"value"= runif(80))
#Generate the plot
ggplotly(
ggplot(data,
aes(x=year, y=value, fill=type)) +
geom_area(col="grey", size=0.5) #set the line col so that you can see the activation when close to the line
)
Calling
ggplotly
onggplot
invokinggeom_area
results in a plot in which the tooltip activates when hovering over the "lines" separating the areas. I would have expected the tooltip to activate when hovered over thefilled
area.Here is some reprex
I don't see any open or closed issues on this. Online, I only see this solution: https://stackoverflow.com/questions/47331323/ggplotly-and-geom-area-display-informations-when-hovering-over-an-area-not-a, which seems convoluted.
Regardless of that solution, I would still assume the expected behavior for
geom_area
is for the tooltip to activate over the area, not the line.The text was updated successfully, but these errors were encountered: