Skip to content
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

Hover text #20

Open
grokasper opened this issue Oct 23, 2022 · 2 comments
Open

Hover text #20

grokasper opened this issue Oct 23, 2022 · 2 comments

Comments

@grokasper
Copy link

Is there any way to change the hover text for this? I'd like to use ggplotly if possible. As of now, I've been able to get rid of the messy auto-hover-text and have it just show the day number / color label on the hover.

Thanks!

@mschilli87
Copy link

@grokasper: Would you mind sharing some code and screenshots to explain what you are trying to achieve?

@grokasper
Copy link
Author

ugly hover

This first image shows the default hover text that appears when you run calendR within ggplotly.

better hover

Adding tooltip = "text" to the end of the code line, I get this hover text, which is better.

I have a database that contains dates, numeric 'intensity' values (which I use to determine the color), and categorical color values (which is how I create different events to color-code the calendar accordingly). It would be great if I could hover over a date and have it show the numeric value that lines up with the date in my database.

My code to create the plot is below:

ggplotly( calendR::calendR(year = 2022, orientation = c("landscape"), title = c("Year View"), special.days = events, special.col = c("lightblue", "lightgreen", "white", "red", "yellow"), legend.pos = "top"), tooltip = "text" ) %>% layout(height = 2000) %>% config(modeBarButtons = list(list("resetViews")))

format

Nowhere in the code is my dataset with dates / colors / numeric values referenced, so I don't know how I could access these values through the calendR plot. I'm also confused why there are different size gaps between rows and why the heights of the three rows are different.

Thank you!

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