I'm trying to render a simple geom_line with a tooltip defined by a text aesthetic.
q <- ggplot(data = graphDataFactor(), aes(x = Dates,
y=Variable_Data,
colour = Variable_Name
#,
#text = paste('Date: ', as.Date(Dates),
#'<br>Variable:', Variable_Name,
#'<br>Var Unit:', Variable_Data
#)
)) +
geom_line(size = 1) +
labs(colour = "Variables")
ggplotly(q
#, tooltip = c("text")
)
So this code with the text aesthetic commented out works fine and renders the line. However, when I try to use the text aesthetic and tooltip, the geom_line does not appear in the plot. Hovering over the correct locations does show the right tooltip, and the colour legend displays properly.
Also, I have an identical call where the only difference is that I call geom_point rather than geom_line and that renders perfectly fine.
Is this just a bug with ggplotly or is there something wrong with my code?