I try to put the title in the bottom. I saw the yanchor = "bottom"
attribute but cant manage to use it.
Any idea ?
iris %>%
count(Species) %>%
plot_ly(labels = ~ `Species`,
values = ~n,
type = 'pie',
textposition = 'inside',
textinfo = 'label percent',
insidetextfont = list(color = '#FFFFFF'),
hoverinfo = 'label percent',
showlegend = FALSE) %>%
layout(title = "I need to be in the bottom")
CodePudding user response:
You can use this code:
iris %>%
count(Species) %>%
plot_ly(labels = ~ `Species`,
values = ~n,
type = 'pie',
textposition = 'inside',
textinfo = 'label percent',
insidetextfont = list(color = '#FFFFFF'),
hoverinfo = 'label percent',
showlegend = FALSE) %>%
layout(title = list(text = "I need to be in the bottom", y = 0.05))
Output: