Inkscape.org
Beginners' Questions Creating a pie "chart"
  1. #1
    ShlomoBachar ShlomoBachar @ShlomoBachar

    How can I create a symmetric pie chart?

    I mean, a circle divided to "n" slices (like a pizza) and each slice painted to a different color?

    What is the fastest way possible to do that?

  2. #2
    Polygon Polygon @Polygon🌶

    Perhaps like so:

  3. #3
    ShlomoBachar ShlomoBachar @ShlomoBachar

    OK...

    I tried. It almost worked. But how do you succeed to snap the duplicated pie to the existing pie?

    In my case it doesn't snap. I mean the corner of the duplicated pie does not snap to the corner of the existing pie.

    It snaps to the mid point of the outer arc but not to the corners...(even if all the snap options are selected).

  4. #4
    Polygon Polygon @Polygon🌶

    Snapping is enabled via ctrl-key and increments are defined in Inkscapes Preferences.

  5. #5
    David248 David248 @David248

    You only need to snap to "cusp nodes" and "rotation center" and ... enable snapping

  6. #6
    Tyler Durden Tyler Durden @TylerDurden

    Usually it is counter-productive to enable many snaps. As David248 points out, only two are needed in this case.

  7. #7
    Polygon Polygon @Polygon🌶

    Or no Snapping at all and just ctrl-key.

  8. #8
    Xav Xav @Xav👹
    👍

    A couple of tips that may speed up this approach:

    1. When rotating using the Select tool, holding Shift will cause the rotation centre to temporarily be placed at the opposite handle to the one you're dragging. So in Polygon's animation, when rotating the first duplicate you can Shift-drag the bottom-right handle and it will rotate around the top-left point, without you having to manually position the rotation centre first.
    2. Inkscape 1.3 adds a keyboard shortcut for "Duplicate and transform" (Ctrl-Alt-D by default), which will create a duplicate and apply the last transformation to it. In this case, after rotating the first duplicate, while it's still selected just press Ctrl-Alt-D several times until the full circle is completed.

    The first tip does only really works for rotations that work when snapped with the Ctrl key - e.g. the 12-segment pie chart being demonstrated above. But the original question was about "n" slices, so here's how I would go about doing this for (say) 7 slices:

    1. Per Polygon's animation above, set the end handle to '360/7'
    2. Duplicate the segment (Ctrl-D)
    3. Switch to rotation mode, then move the centre of rotation to the top-left (i.e. the pointed corner of the segment)
    4. Use the Object > Transform dialog to rotate the duplicate by '360/7'
    5. Repeatedly press Ctrl-Alt-D to duplicate and transform the remaining segments (tip 2 above)
    6. Select each segment one-by-one and set the fill colour to whatever you want