5

I would like to change the position of the hover box in a plotly bar chart. Rather than have it popup on the left or right, I would like it to popup above the bar. Is this possible? I've been googling this and staring at the Plotly R reference page for a couple hours with no luck.

Here's a sample:

library(dplyr)
library(plotly)
data.frame(x = 1:10, y = 1:10*10) %>% 
  plotly::plot_ly(data = .) %>%
  plotly::add_trace(x = ~x, 
                    y = ~y, 
                    type = 'bar', 
                    hoverinfo = "text", 
                    text = ~y)
ismirsehregal
  • 30,045
  • 5
  • 31
  • 78
hmhensen
  • 2,974
  • 3
  • 22
  • 43
  • ```g <- data.frame(x = 1:10, y = 1:10*10) %>% plotly::plot_ly(data = .) %>% plotly::add_trace(x = ~y, y = ~x, type = 'bar', hoverinfo = "text", text = ~y, orientation = "h")``` is this close enough? I know it can be done in `plotly.js` but in `r` I just could not find anything related. – M-- May 31 '19 at 21:19
  • @M-M Thanks, but I need to keep columns. Plotly in R seems to be missing a lot of features. Even bolding text is a chore. – hmhensen May 31 '19 at 21:23

0 Answers0