I have build a surface chart with plotly and I am trying to have hoverinfo based on my own text. Curiously it is not working anymore.
library(plotly)
x <- rnorm(10)
y <- rnorm(10)
z <- outer(y, x)
p <- plot_ly(x = ~x, y = ~y, z = ~z, type = "surface",
text = ~paste0("My X = ", x, "\n My Y = ", y, "\n My Z = ", z),
hoverinfo = "text") %>% layout(dragmode = "turntable")
print(p)
Although
p <- plot_ly(x = ~x, y = ~y, z = ~z, type = "surface") %>% layout(dragmode = "turntable")
works well.
I have also tried to substitute \n
by <br />
with no effect.
I am using R 3.4.0 and plotly 4.7.0 on macOS Sierra.
Any suggestions?