Pie Charts3:31 with Michael Watson
Learn about pie charts, and where they are useful for visualizing data.
Pie charts are kinda funny to me. 0:00 On the one hand, they're one of the first charts I was ever exposed to in school. 0:01 They are simple and easy to understand. 0:06 On the other hand, the story told by a pie chart often would be told 0:08 just as well if not more clearly by a column chart. 0:13 That said, pie charts are great for 0:16 showing the sum of parts at a particular point in time. 0:18 You have 24 hours in a day, how did you spend it? 0:21 You consumed 18,000 calories of food and beverages last week, 0:25 how did that break out? 0:29 We wrote 100 jokes during our meeting, what types? 0:30 A pie chart is a good way to show a snapshot allocation. 0:34 They are not great for showing changes over time. 0:37 One data scientist I know jokingly said about pie charts, don't ever use them. 0:41 I think that's a bit extreme, but again, just remember to ask yourself, 0:47 am I telling the story more clearly with this chart than another option? 0:51 If the answer is no, then don't use it. 0:58 If the answer is, they're both the same, then exercise your freedom to choose. 0:59 One industry that you tend to see a lot of pie charts in is wealth management. 1:04 Financial advisors will use pie charts to show how an investment portfolio has been 1:08 allocated across different asset classes or investment strategies. 1:13 This is because they're showing how all your invested wealth, the pie, 1:17 is being split up and allocated. 1:22 Here we are, looking at a simple dataset of salary information for 1:25 one of our competitors. 1:29 Just kidding, it's made up data. 1:32 But anyhow, let's make a pie chart out of it. 1:33 So again, I'm gonna select the data I wanna chart. 1:37 I'm going to use a keyboard shortcut. 1:41 ALT N and the shortcut for a pie chart is Q, 2D is what I want. 1:43 And voila, we have our pie chart. 1:52 So you can see our biggest salary expense is in sales, 1:57 then marketing, then product. 2:02 We could rearrange the data series to go from largest to smallest to make that more 2:07 clear, but I'm gonna skip that for now and 2:11 wanna call out what happens when we mouse over the chart. 2:14 See you can see the series name, but then for the pie chart, 2:17 it also shows us the percent of total value along with the value itself. 2:21 I think that's where a pie chart can be more valuable, 2:26 if you show the percent of total values along with the chart. 2:30 So let's add some data labels. 2:34 I want to right click on the chart, add data labels. 2:36 Right now, it's just showing us the nominal values for 2:43 those different data series, but I can go down here and 2:47 format the data labels and check this percentage box. 2:51 And I could deselect the values, and there we go. 2:56 Remember though, it all depends on the story you're trying to tell. 3:00 If the percent of total isn't really important, and you're wanting to see 3:04 the relative value of how much is being spent on each division, 3:09 I'd argue that a column chart tells that story more clearly than a pie chart. 3:13 So let's change this back to a column chart. 3:18 Here, we can clearly see the relative value. 3:24 Sales is by far the highest and Admin the lowest. 3:27
You need to sign up for Treehouse in order to download course files.Sign up