Hover info/tooltip is using y labels and not values which causes problems with boxplots hoverinfo
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
When you use your own labels for values on x or y axis then hoverinfo/tooltip will show these labels. This is generally ok but it is problem for boxplots, where you cannot change hoverinfo text. For example, you want to make boxplot of some time values (in minutes) but you want to format labels on y axis to HH:MM. If some value of a quartile hit the value displayed on y axis, the hover info will show HH:MM label for this value while for other values it will show just time in minutes... See the hoverinfo for the first and the third quartile compared to other values on the figure bellow. Any suggestion how to fix it or make it consistent so the formatting is the same? Thank you!
library(ggplot2)
library(plotly)
p<-ggplot()+
geom_boxplot(aes(x="A", y=c(5,15,25,25,45,72)))+
scale_y_continuous(breaks=seq(0, 75,15), labels=c("00:00","00:15","00:30","00:45","01:00","01:15"))+
ylab("")
ggplotly(p)

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example with ggplot2 and plotly using ggplotly(p), then inspect how the boxplot hover information is generated when scale_y_continuous supplies custom labels. Compare quartile values that match labeled ticks with other values, and verify that the resulting tooltip formatting is consistent for all boxplot values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100