calendR icon indicating copy to clipboard operation
calendR copied to clipboard

Hover text

Open grokasper opened this issue 3 years ago • 2 comments

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!

grokasper avatar Oct 23 '22 21:10 grokasper

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

mschilli87 avatar Oct 24 '22 04:10 mschilli87

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!

grokasper avatar Oct 24 '22 15:10 grokasper