The hover name that appears outside the hover box on my plotly plot is getting cutoff because of the long names. I have found solutions for plotly.js and plotly.py but not R. I have been able to remove that name from the hover or move it into the box with the value, but need a solution that keeps it in place while allowing the entire name to be visible.
# sample data
Value <- rnorm(100, mean = 5)
Time <- c(1:100)
Site <- "Really long name for Site 1"
datTemp <- data.frame(Time, Value, Site)
Value <- rnorm(100, mean = 5)
Time <- c(1:100)
Site <- "Really long name for Site 2"
datTemp2 <- data.frame(Time, Value, Site)
Value <- rnorm(100, mean = 5)
Time <- c(1:100)
Site <- "Really long name for Site 3"
datTemp3 <- data.frame(Time, Value, Site)
figTemp<-datTemp%>%
plot_ly(x = ~Time, y = ~Value, type = "scatter", mode = "lines", line = list(width = 0.75), name = ~Site[1])%>%
layout(xaxis = list(title = "Date"), yaxis = list(title = "Temperature (C)"), legend = list(x = 0, y = 1.05, orientation = "h"))
figTemp<-figTemp%>%
add_trace(data = datTemp2, y = ~Value, type = "scatter", mode = "lines", name = ~Site[1])%>%
add_trace(data = datTemp3, y = ~Value, type = "scatter", mode = "lines", name = ~Site[1])