plotly / plotly/plotly.R

Hover info/tooltip is using y labels and not values which causes problems with boxplots hoverinfo

Open
#706 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ggplotly
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)

boxplot

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.