ggradar icon indicating copy to clipboard operation
ggradar copied to clipboard

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

Open makis23 opened this issue 5 years ago • 2 comments

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)

makis23 avatar Feb 26 '20 11:02 makis23

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.

ccbvib avatar Jul 28 '22 10:07 ccbvib

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

EnzoNMigliano avatar Jul 28 '22 12:07 EnzoNMigliano