I am using ggplotly to show an interactive time-series plot. The x axis is in date format, yet the hover tool tip in plotly is converting the date format to a numeric (scre
If you use just text in your tooltip, you can render a more complex tooltip by using the text element you pass to ggplot. You just need to call as.Date and use some html tags as follows:
# draw the line plot using ggplot
gg <-ggplot(plotbycity, aes(x = date, y = rent, group = city, color = city,
text = paste('Rent ($):', rent,
'
Date: ', as.Date(date),
'
Obs: ', count))) +
geom_line() +
ggtitle("Monthly Rents")
p <- ggplotly(gg, tooltip = c("text"))
Hope that helps!