-
Book Overview & Buying
-
Table Of Contents
The Data Visualization Workshop
By :
Composition plots are ideal if you think about something as a part of a whole. For static data, you can use pie charts, stacked bar charts, or Venn diagrams. Pie charts or donut charts help show proportions and percentages for groups. If you need an additional dimension, stacked bar charts are great. Venn diagrams are the best way to visualize overlapping groups, where each group is represented by a circle. For data that changes over time, you can use either stacked bar charts or stacked area charts.
Pie charts illustrate numerical proportions by dividing a circle into slices. Each arc length represents a proportion of a category. The full circle equates to 100%. For humans, it is easier to compare bars than arc lengths; therefore, it is recommended to use bar charts or stacked bar charts the majority of the time.
To compare items that are part of a whole.
The following diagram shows household water usage around the world:
Figure 2.21: Pie chart for global household water usage
An alternative to a pie chart is a donut chart. In contrast to pie charts, it is easier to compare the size of slices, since the reader focuses more on reading the length of the arcs instead of the area. Donut charts are also more space-efficient because the center is cut out, so it can be used to display information or further divide groups into subgroups.
The following diagram shows a basic donut chart:
Figure 2.22: Donut chart
The following diagram shows a donut chart with subgroups:
Figure 2.23: Donut chart with subgroups
Stacked bar charts are used to show how a category is divided into subcategories and the proportion of the subcategory in comparison to the overall category. You can either compare total amounts across each bar or show a percentage of each group. The latter is also referred to as a 100% stacked bar chart and makes it easier to see relative differences between quantities in each group.
The following diagram shows a generic stacked bar chart with five groups:
Figure 2.24: Stacked bar chart to show sales of laptops and mobiles
The following diagram shows a 100% stacked bar chart with the same data that was used in the preceding diagram:
Figure 2.25: 100% stacked bar chart to show sales of laptops, PCs, and mobiles
The following diagram illustrates the daily total sales of a restaurant over several days. The daily total sales of non-smokers are stacked on top of the daily total sales of smokers:
Figure 2.26: Daily total restaurant sales categorized by smokers and non-smokers
Stacked area charts show trends for part-of-a-whole relations. The values of several groups are illustrated by stacking individual area charts on top of one another. It helps to analyze both individual and overall trend information.
To show trends for time series that are part of a whole.
The following diagram shows a stacked area chart with the net profits of Google, Facebook, Twitter, and Snapchat over a decade:
Figure 2.27: Stacked area chart to show net profits of four companies
In this section, we covered various composition plots and we will conclude this section with the following activity.
You want to compare smartphone sales units for the five biggest smartphone manufacturers over time and see whether there is any trend. In this activity, we also want to look at the advantages and disadvantages of stacked area charts compared to line charts:

Figure 2.28: Line chart of smartphone sales units
Note
The solution for this activity can be found via this link.
Venn diagrams, also known as set diagrams, show all possible logical relations between a finite collection of different sets. Each set is represented by a circle. The circle size illustrates the importance of a group. The size of overlap represents the intersection between multiple groups.
To show overlaps for different sets.
Visualizing the intersection of the following diagram shows a Venn diagram for students in two groups taking the same class in a semester:
Figure 2.29: Venn diagram showing students taking the same class
From the preceding diagram, we can note that there are eight students in just group A, four students in just group B, and one student in both groups.
Moving on from composition plots, we will cover distribution plots in the following section.
Change the font size
Change margin width
Change background colour