plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

geom_GeomLabelRepel() has yet to be implemented in plotly

Open foma4tune opened this issue 11 months ago • 2 comments

pie chart

df_2 <- data.frame(value = c(15, 25, 32, 28), group = paste0("G", 1:4))

Get the positions

df2 <- df_2 %>% mutate(csum = rev(cumsum(rev(value))), pos = value/2 + lead(csum, 1), pos = if_else(is.na(pos), value/2, pos))

label_piechart <- ggplot(df, aes(x = "" , y = value, fill = fct_inorder(group))) + geom_col(width = 1, color = 1) + coord_polar(theta = "y") + scale_fill_brewer(palette = "Pastel1") + geom_label_repel(data = df2, aes(y = pos, label = paste0(value, "%")), size = 4.5, nudge_x = 1, show.legend = FALSE) + guides(fill = guide_legend(title = "Group")) + theme_void()

ggplotly(label_piechart)

foma4tune avatar Feb 07 '25 09:02 foma4tune

Duplicate of #2408

romanzenka avatar Feb 21 '25 17:02 romanzenka

thanks for pointing out it's a duplicate #2408 . Resolving the issue will be greatly appreciated.

foma4tune avatar Feb 26 '25 08:02 foma4tune