Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Hover text not showing for negative values (on horizontal bar chart), shows for positive bars

I’m trying to recreate a graph created with ggplot() with plot_ly() (n a Shiny app).

It’s a horizontal bar chart, with some bars having a negative value. The hover text shows for the bars with positive values but not for bars with negative values.

ppxx <- dd %>%
plot_ly( x = ~dd$heights, y = ~dd$Names, color = ~dd$Enriched, type = “bar”, orientaton = “h”,
hoverinfo = “text”, text = my_text ) %>%
add_markers( x = ~dd$low - 0.5, y = ~dd$Names, marker = list(symbol=142, color=“black”), showlegend = FALSE ) %>%
add_markers( x = ~dd$high - 0.5, y = ~dd$Names, marker = list(symbol=142, color=“black”), showlegend = FALSE,
hoverinfo = “none” ) %>%
add_segments( x = ~dd$low - 0.5, xend = ~dd$high - 0.5, y = ~dd$Names, yend = ~dd$Names, color = toRGB(“black”),
showlegend = FALSE, hoverinfo = “none”) %>%
layout(title =NULL, xaxis = my.xaxis, margin = list(l=120,t=50,b=30,unit=“pt”,pad=2),
yaxis = list(title=""))

Full code is at
deployed at

I have a similar issue. I am using the ggplotly() function in order to convert from ggplot() to plotly(). First i make a plot of two geom_area() with the same data.frame but different columns, then wrap it inside the ggplotly() and for the positive side it shows the text when hover, but in the negative side shows the labels but with no value.

I have google it and still no answer or possible reason, any guidance will be appreciated.