I have a simple data frame:
seq <- 1:10
name <- c(paste0("company",1:10))
value <- c(250,125,50,40,40,30,20,20,10,10)
d <- data.frame(seq,name,value)
And I want to plot it this way:
require(ggplot2)
ggplot(data = d,aes(x=seq,y=value))+geom_line() + geom_point()
Now I want to use plotly, mostly to be able, when mousing over a point, to get other information than the value, such as the company name. I try this :
require(plotly)
ggplotly()
which get me a tooltip, but with only seq and value. I tried the option tooltip= but it's specified you can use the only variable describe in the aesthetic, and I don't use the name in my aes.
Any solution? I saw I am not the first with this problem, but I haven't found answer working with ggplotly.
See Question&Answers more detail:os