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

Display actual values instead of coordinates when using ggplotly in combination with ggradar #36

Open
makis23 opened this issue Feb 26, 2020 · 2 comments

Comments

@makis23
Copy link

makis23 commented Feb 26, 2020

I use ggradar in combination with plotly to create a radar chart. After using plotly to obtain the hover-text ability I get the coordinates of every point when I mouse over each point but this does not make sense to me. How can I get the actual values instead of coordinates?

library(ggradar)
library(dplyr)
library(scales)
library(tibble)
library(plotly)
mtcars_radar <- mtcars %>% 
  as_tibble(rownames = "group") %>% 
  mutate_at(vars(-group), rescale) %>% 
  tail(4) %>% 
  select(1:10)

p<-ggradar(mtcars_radar)
ggplotly(p)
@ccbvib
Copy link

ccbvib commented Jul 28, 2022

I am also experiencing this problem. The ggradar legend does not display class labels (i.e. row names of the input data) instead it displays the min/max point corresponding to each axis. I have tried to coerce the labels to appear in the legend without success.

@EnzoNMigliano
Copy link

Hi @ccbvib and @makis23!

I have something that might help you. A few years ago, I did a radar visualization with plotly and ran into the same issue. However, I did some edits to ggradar's source code so it would add a tooltip with customized values to the plotly.

I created a GitHub repository with this customization for you:

https://github.com/EnzoNMigliano/Modified_ggradar_to_Support_plotly_Tooltip

I hope it helps!

Cheers!

Enzo

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

3 participants