I would like to put the labels of my doughnut charts in the middle of those, but I tried a solution and it doesn't appear where I want. It's for a teamwork project so any help would be really appreciated. Thank you.
Here is our code:
p1 <- plot_ly(tab2, labels = ~c("Domicile-Travail","Domicile-ecole","Courses-achats","Utilisation professionnelle","Promenade-loisirs","Autre"), values = ~prop, type = 'pie',textposition = 'middle right',
textinfo = 'percent',subtitle="B", hole= "0.5",domain = list(x = c(0, 0.45), y = c(0, 1)),insidetextfont = list(color = '#FFFFFF'),
hoverinfo = 'text')
p2 <- plot_ly(tab3, labels= ~c("Domicile-Travail","Domicile-ecole","Courses-achats","Utilisation professionnelle","Promenade-loisirs","Autre"), values = ~prop, type = 'pie', textposition = 'middle left',
textinfo = 'percent',hole= "0.5", domain = list(x = c(0.55,1), y = c(0, 1)), insidetextfont = list(color = '#FFFFFF'),
hoverinfo = 'text', annotations=list(text="B",x=0,y=0,label=2013))
subplot(p1,p2)%>%
layout(title = "Nombre d'accidents par type de trajet ",
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
No comments:
Post a Comment