title: raphael.js - converting pie graph to donut graph
body: <p>I'm trying to use a raphael.js example located here:</p>
  
  <p><a href="http://raphaeljs.com/pie.html" rel="nofollow noreferrer">http://raphaeljs.com/pie.html</a></p>
  
  <p>but I want to convert the pie graph into a donut graph (have a hole in the middle of all the slices). Currently, each slice is being created with the following code:</p>
  
  <pre><code>function sector(cx, cy, r, startAngle, endAngle, params) {
          //console.log(params.fill);
          var x1 = cx + r * Math.cos(-startAngle * rad),
              x2 = cx + r * Math.cos(-endAngle * rad),
              y1 = cy + r * Math.sin(-startAngle * rad),
              y2 = cy + r * Math.sin(-endAngle * rad);
          return paper.path(["M", cx, cy, "L", x1, y1, "A", r, r, 0, +(endAngle - startAngle &gt; 180), 0, x2, y2, "z"]).attr(params);
      }
  </code></pre>
  
  <p>How would I modify this so that a hole of a fixed radius was removed from the overall pie? I saw this post here, which helps, but I can't quite tell how or where to apply it to my code above:</p>
  
  <p><a href="https://stackoverflow.com/questions/3349651/how-to-achieve-donut-holes-with-paths-in-raphael">How to achieve &#39;donut holes&#39; with paths in Raphael</a></p>