Creating a Pie chart

Just like bar charts, pie charts too are very widely used. They are typically used to show relative proportions or percentage distributions, and the size of the slice indicates the contribution to the total value.

The pie chart in Tableau uses the Pie mark type.

Getting ready

In the following recipe, we will create a Pie chart to show the sales across different customer segments. We can create a Pie chart by selecting the necessary fields from the Dimensions and Measures fields and then selecting the Pie chart option from Show Me!. However, in the following recipe, we will build it manually using the Marks card. Let's see how this can be done.

How to do it…

  1. Create a new sheet and rename it to Pie chart.
  2. Then select Pie mark from the Marks dropdown in the Marks card. Refer to the following image:
    How to do it…
  3. Next, let us drag Sales from the Measure pane and drop it into the Size shelf. Follow this up by dragging the Sales field again from the Measure pane and this time dropping it into the Angle shelf in the Marks card.
  4. Since we want to show the distribution of the customer segment, we will drop Customer Segment into the Color shelf. Refer to the following image:
    How to do it…

How it works…

When we select Pie as a mark from the Marks dropdown, an additional shelf called Angle is available and determines the angular measure of the pie slices/wedges.

In the preceding image, when we place Sales in the angle shelf, the complete 360 degrees circle, representing the total sales, is divided into three slices/wedges, and shows the value for each customer segment.

When we look at the chart, we get to see how much of sales is being contributed by which customer segment, and these segments can be identified by referring to the Color legend.

Thus, in the preceding chart, most sales are contributed by the Consumer segment.

Even though pie charts are widely used, many data visualization experts do not encourage their use. Some of the many reasons are mentioned as follows:

  • The human eye is not very good at estimating area but are better at comparing heights. For example, if there are two categories with approximately the same values and we decide to create a Pie chart, then it would be very difficult to say which category has more value as both slices will more or less be of the same size. But if we represent the same information in a bar chart, then it would be easier to compare the height or the length of the bars and determine which category has more value.
  • In a pie chart, we can only compare slices that are right next to each other.
  • If we have a greater number of categories to plot, then creating a pie chart will only make it difficult to quickly and meaningfully interpret the slices of the pie as there would be too much color and this can be distracting; also, the slices would be small. Imagine creating a pie chart to show 20 categories. Experts suggest that if we have more than six proportions to communicate, then one should consider a bar chart instead of a pie chart.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.38