How do I change the hover text in ggplotly?

A simple solution is to name the variables correctly before making the plot, see this example

library(quantmod)
library(tidyverse)
library(plotly)

apple <- getSymbols("AAPL",
                    src = "yahoo",
                    from = "2019-09-20",
                    to = "2020-09-20",
                    auto.assign = FALSE)

p <- apple %>% 
    as.data.frame() %>% 
    rownames_to_column(var = "Date") %>% 
    transmute(Date = as.Date(Date), Price = AAPL.Adjusted) %>% 
    ggplot(aes(Date, Price)) +
    geom_line()

ggplotly(p)

BTW, next time please provide a proper REPRoducible EXample (reprex) illustrating your issue, what you have done (screenshots), although I'm sure well intended, it can be interpreted as rude since you force people willing to help you, to type from an image.

1 Like