How to add data labels to a radar chart


Hope everything's going fine for you.

I'm currently working with the fmsb package to build a radarchart.

I've made a dataframe like this one to be able to draw the chart :

spyder_data <- data.frame(DuelsAeriensOff = c(20, 0, DuelsAeriensOff),
                   DuelsAeriensOffGagnes = c(1, 0, DuelsAeriensOffGagnes),
                   ButTirs16  = c(0.2, 0, ButTirs16),
                   TirsBloques = c(1, 0, TirsBloques),
                   ConversionPasses16 = c(0.2, 0, ConversionPasses16),
                   PassesMatch16 = c(20, 0, PassesMatch16),
                   PassesReussies16 = c(1, 0, PassesReussies16),
                   DangerositePassesCles = c(0.2, 0, DangerositePassesCles),
                   PartCentresSurface = c(1, 0, PartCentresSurface),
                   DistancePassesSurface = c(20, 0, DistancePassesSurface),
                   row.names = c("max", "min", "value"))

and I'm drawing the radarchart with the fonction like this :

           vlabels = labels,
           vlcex = 0.5,
           cglcol = "grey",
           cglty = 1,
           pcol = c(scales::alpha("orange", 1)),
           pfcol = c(scales::alpha("orange", 0.4)),
           plwd = 2

Everything is going fine and I'm obtaining this chart :

But I would like to add data labels next to my oranges chart's points, who are contain in the third column of my spyder_data dataframe.

I searched for hours this afternoon but I didn't find anything... except maybe using the function text() but I don't know how to do it since it's a specific chart.

If anyone have an idea about my issue, I would be very grateful. Have a good evening.

have you tested the example code you shared ?

Error in data.frame(DuelsAeriensOff = c(20, 0, DuelsAeriensOff), DuelsAeriensOffGagnes = c(1,  : 
  object 'DuelsAeriensOff' not found

Of course I did, if I didn’t I would not have the graph. You may have this error because DuelAeriensOff is calculated before in my script !

Im afraid this makes it harder to help you. Also the third column of labels you want to add, seems absent.

My dataframe is looking like that

Capture d’écran 2020-12-11 à 09.53.43

Is there no way to use the line "value" as data label to get the values next to the points on the graph ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.