title: Open Pie Chart/Donut Chart in R using Plotly with count and percentage
body: <p>I'm trying to make a donut chart in R using plotly. I tried ggplot, but it wasn't able to give me the effect that I need. Here's a sample dataset:</p>
  
  <pre><code>library(dplyr)
  testfile &lt;- tibble(personID = 1:10,
                     status = c("bad", "good", "bad", "bad", "bad", "bad", "bad", "bad", "bad", "good"),
                     department = c("sales", "sales", "marketing", "sales", "marketing", "management", "management", "sales", "sales", "sales"))
  </code></pre>
  
  <p>This chart will end up in a PowerPoint, so it does not need to be responsive. Instead, I need the pie chart to say, without scrolling over it, the % that falls into each status <em>and</em> the count. Also, in the center of the pie chart, I want it to say the % that are in the "good" category.</p>
  
  <p>This is the code that I have so far. It has the percentage visible without scrolling but not the count and it does not have the percentage in the center.</p>
  
  <pre><code>library(plotly)
  p &lt;- testfile %&gt;%
    group_by(status) %&gt;%
    summarize(count = n()) %&gt;%
    plot_ly(labels = ~status, values = ~count) %&gt;%
    add_pie(hole = 0.6) %&gt;%
    layout(title = "Ratio of Good to Bad",  showlegend = F,
           xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = TRUE),
           yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = TRUE))
  </code></pre>
  
  <p>Also, if you could show how to facet_wrap it by department, that would be very helpful. I keep getting it to say NULL!</p>
  
  <p>Thank you!</p>