Stacked bar charts

ggplot(___) + 
  geom_col(
    mapping = aes(x = ___, y = ___, 
                  fill = ___)
 )
View Interactive Version

In some circumstances it might be useful to plot multiple numeric values variables within each bar. Examples are numeric values describing one specific entity (e.g. customers) split among various categories (customer segments) so that the bar height represents the total number (all customers).

The plot below shows the number of phones (in thousands) by continent from 1956 to 1961 as a stacked bar chart:

Input
ggplot(world_phones) + 
  geom_col(aes(x = year, y = phones,
               fill = region))
Create your first bar chart