HowTo: Make Pretty Pie Charts 4 January, 2007 — Stuart Brown

Using Adobe Illustrator CS2

Posted in Design, Tutorials
Tagged with: , , , , , , ,

If you remember the post about the Demographics of Digg I wrote back in early December, one of the general themes of the associated Digg comments was the overwhelming niceness of the pie charts. Being the generous sort that I am, I thought I'd do a comprehensive tutorial of how to achieve the same effect - I'm using Adobe Illustrator CS2, but the tips should apply to most of the more recent versions.

Update: Here's the second part of this tutorial.

  1. Open Illustrator, create a new document [Ctrl-N]. Any page size will do. If you're designing pie charts for the screen, you may want to ensure that the RGB colour mode is selected.

  2. Select the 'Pie graph' tool from your toolbar. (Click-hold on the default Column graph tool to access the other stat tools). The pie graph tool takes care of the mathematics and angular calculations for us.

  3. Drag out a suitably large bounding box for your pie chart with the pie chart tool selected. The data entry field (as below) should appear.

  4. Data entry is simple enough - just enter your figures in the order you wish them to appear on the pie chart, pressing tab to move horizontally between each figure. Once you're done, press keypad enter to draw the (rather basic) pie chart.

  5. Next, select the Selection Tool (black arrow), close the date entry box, and select the freshly made pie chart. It may be worthwhile checking your data at this point to make sure you've not made any mistakes, as you won't be able to tweak the data figures later on.
  6. Once you're happy with the data, we can proceed to style the pie chart. Making sure the pie chart is still selected, press [Ctrl - Shift - G] (or select 'Ungroup' from the 'Object' menu) to break the pie into its component parts. Click 'yes' on the dialog box that appears, then press [Ctrl - Shift - G] a further 3 times to completely ungroup the pie chart. Once you've done this, the Appearance palette should read 'Path / Mixed Appearances'.

  7. You should now be able to select the individual pie pieces. From here we can apply whatever styling and effect that we like to the pie charts - to begin, select the first piece of the pie using the selection tool, as below.

  8. First step in the pie slice styling is to assign a basic colour fill. In the Appearance palette, select the 'Fill' attribute, then use either the Color palette, or Swatches to assign your chosen basic fill to the pie slice.

    (You may have noticed in some of the pie charts in the 'Demographics of Digg' I've used a picture - this is done with a pattern fill in Illustrator, which I cover in the second part of this tutorial.
  9. Next, select 'Stroke' in the Appearance palette, then select the white swatch, and specify a line weight of around 2px in the Stroke Palette. The pie slice should look something like the following:

  10. Next, we'll add gradient fill to the slice. Go to the Appearance palette, and click the small right facing arrow in the circle to bring up a menu (as below). Click Add New Fill to add a second fill to the object.

  11. Make sure the new fill is selected, and in the Gradient palette, select 'Radial' from the drop down menu and specify a white > black gradient, as below:

  12. Select the gradient tool (as pictured), then drag from the center of the pie chart to the outside of the pie slice. The resulting gradient should look the same as the screenshot below.

  13. In the transparency palette, select Soft Light from the drop-down menu and drop the opacity to around 50-75%, as per the base colour selected, and the desired strength of the gradient effect.

  14. Now, repeat steps 7 - 13 for each pie slice. You can speed up this process by selecting an unstyled pie slice, and using the eyedropper tool click on the slice you've just styled. Then, using the appearance palette you may change the base colour to differentiate the pie slice. You may also have to use the gradient tool on each slice to make sure the gradient is aligned to the slice correctly.
  15. Once you're finished, you should have something that looks like this:

  16. We're not quite finished yet. Next, we'll apply a glossy effect to the whole of the pie chart. Select the ellipse tool from the tool palette.

  17. Next, select a white fill and no stroke, and holding down Alt and Shift click and drag from the centre of the pie chart to a short distance away from the outside edge - something like this:

  18. Make sure the newly created circle is selected, navigate to the transparency palette, click on the right facing arrow in the circle in the top right of the palette, and select 'Make Opacity Mask'.

  19. In the transparency palette, click on the right-hand black square to edit the opacity mask.

  20. Draw a white filled rectangle using the rectangle tool that completely covers the pie chart. Then, apply a linear gradient using the gradient palette, and set the gradient to the same white > black that you used for the pie slice shading (you shouldn't need to change this). Next, use the gradient tool and drag from the top of the white circle to the bottom. You should have something that looks like this:

  21. Navigate back to the transparency palette, and click on the left-hand square to exit the opacity mask. Next, change the opacity slider to 50% to make the gloss effect more subtle.

  22. To finish off the pie chart, you may want to add a drop shadow. Go to Effects > Illustrator Effects > Stylise > Drop Shadow in the menu, and apply with the following settings, or tweak to taste:

  23. To further embellish your pie chart, add some labels (compound paths consisting of a rounded rectangles with a long pointy triangle - solid white fill with 1.5px black stroke) with a nice font (I've used Myriad Pro), and their own drop shadows.

    That just about concludes the tutorial - there are plenty of other flourishes that can be added, but the above covers the basics, and experimentation will yield further results. This is exactly the same method as I used in the 'Demographics of Digg' charts, with the exception of custom pattern fills (covered in part two of this tutorial). You can download the Illustrator file for this tutorial here.