I want to plot this two pie charts on the same plot. Below you can see my data:
library(plotly)
library(dplyr)
library(grid)
Share<- structure(list(Y = c(2018, 2018, 2019, 2019), Categorie = c("Before","After", "Before","After"), Share = c(1.0,99., 3, 97)), row.names = c(NA,-4L), class = c("tbl_df", "tbl", "data.frame"))
I try with this lines of code but I can't find solution.
fig1 <- plot_ly(Share, labels = ~Categorie , values = ~Share, type = 'pie')
fig2 <- plot_ly(Share, labels = ~Categorie , values = ~Share, type = 'pie')
PLOT<-subplot(fig1,fig2,nrows=2,margin = 0.05)
So can anybody help me how to solve this and make plot like pic below but with Donut Charts: