Skip to content

hovermode = "common" not displaying correct interval for histogram #1983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bklingen opened this issue Jul 20, 2021 · 2 comments
Closed

hovermode = "common" not displaying correct interval for histogram #1983

bklingen opened this issue Jul 20, 2021 · 2 comments

Comments

@bklingen
Copy link

I would have expected the x hover label to read "50 - 100" (or "50 - 99"), but instead it shows "50 - 90". (And is similarly off for the other bins.) Such odd behavior occurs for a variety of datasets, but works correctly for others.

image

library(plotly)
x <- c(0, 50, 70, 100, 130, 140, 140, 150, 160, 180,
       180, 180, 190, 200, 200, 210, 210, 220, 290, 340)
plot_ly(
  data = data.frame(x=x),
  x = ~x,
  type = "histogram",
  marker = list(line = list(color = 'white', width = 1))
) %>%
  layout(
    xaxis = list(ticks = "outside"), #hoverformat = ".2f"),
    hovermode = "common"
  )
@bklingen
Copy link
Author

@bklingen
Copy link
Author

Continuing discussion in plotly/plotly.js#5848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant