I would like to use hovermode ‘x’ for a time series plot with multiple traces. Some of them stay at zero for at for a long time, and then the tooltips end up covering the date which is shown in the tooltip along the x-axis.
I am wondering if it is possible to force the tooltips for each trace to stay above the x-axis?
A minimal example illustrating the issue in R:
library(plotly)
library(tidyverse)
set.seed(1)
dat <- data.frame(x = rep(1:5 + 1000, 8), y = sample(c(0,1), 5*8, replace = TRUE, prob = c(.9, .1)), id = factor(rep(1:8, each = 5)))
pl <- dat %>%
group_by(id) %>%
plot_ly(x = ~x, y = ~y) %>%
add_lines(color = ~id) %>%
layout(hovermode = "x")