Skip to content

Changing the DayofYear hover over from ggplot to Plotly? #544

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
ahsanshah opened this issue Apr 10, 2016 · 1 comment
Closed

Changing the DayofYear hover over from ggplot to Plotly? #544

ahsanshah opened this issue Apr 10, 2016 · 1 comment

Comments

@ahsanshah
Copy link

I must be missing something as this should be fairly simple. I have a ggplot for which I have multiple years of data. I needed the data across multiple years to "overlap" on the same plot. The fact that 2016 is a leap year causes issues on the X axis scaling. I looked to see if there was any package or solution but was unable to find anything. As such, I rescaled across LEAP and NON LEAP to have a DAY range of 366 (versus 365 for 2 years and 366 for 2016).

This is all working fine. Howwver, I now want to force PLOTLY to show the DATE value on the Hover over versus the X axis DayofYear. I assumed I can easily overwrite this using something like this which I found.

p_gg_build <- plotly_build(p1)
p_gg_build$data[[2]]$text <- paste("DATE = ", test_tmp$DT_STAY_DATE)

However, this applied to a specific trace (e.g. trace #2). Is there no way to automatically force all traces to have the custom HOVER over? Essentially, how do I force ALL traces to overwrite the custom HOVER text? Is there a simpler option that can allow me to overwrite the ggplot hover text?

Attached code and RDS files for reference.

Support.zip

@cpsievert
Copy link
Collaborator

@ahsanshah you've been asked a handful of times now to follow the guidelines for opening issues. If you continue to ignore the guidelines, we'll have to block you from the repo.

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

2 participants