Hi, I'm not sure if you found a way to solve this yet, but what I did, is that, since you can specify the info shown in "textinfo" is that I would simply add the category to that data. Something similar to:
summrsd_Vtas_Kg_Fam_Can_pie2<- Dataset_Ventas_por_Familia_SubFam_Canal_Subcan1%>%
dplyr::group_by(Familia)%>%
dplyr::summarize(ValorNeto=sum(ValorNeto))%>%
mutate(text = paste("Subfamilia: ", Familia, "\nValor neto: ", ValorNeto, sep=""))
Pievis_Fam <-plot_ly(summrsd_Vtas_Kg_Fam_Can_pie2,
labels= ~Familia,
values= ~ValorNeto,
type='pie',
textinfo = 'label+percent+text',
marker = list(colors = c('#1f5bb4', '#1f76b4','#1f8cb4','#1f9eb4', '#1fb4b4', '#1fb4a5')),
hoverinfo = 'text', text = summrsd_Vtas_Kg_Fam_Can_pie2$text,
showlegend = FALSE
)
Pievis_Fam
Pay special attention to the "text" column in my dataset, and how it's added to the textinfo label.
Regards.