25  Bar Charts

Bar charts are a staple of data visualization, used extensively to compare data across categories. They present categorical data with rectangular bars, where the length of each bar is proportional to the value it represents.

Bar charts can be classified into three types:

  1. Simple bar chart: bars placed at equal distances apart, each representing a single value for a category.

  2. Sub-divided (stacked) bar chart: multiple sub-categories stacked on top of each other within a single bar.

  3. Multiple (grouped) bar chart: bars placed next to each other rather than stacked, each representing a different sub-category within the main category.

25.1 Simple Bar Chart

Structure: a simple bar chart displays rectangular bars with lengths proportional to the values they represent, plotted vertically or horizontally. Each bar represents a single category.

Purpose: simple bar charts compare the magnitude of values across categories, making it easy to see which categories are larger or smaller — for example, total production across different crops in a district.

25.1.1 R Code


25.2 Sub-divided (Stacked) Bar Chart

Structure: a stacked bar chart also uses rectangular bars, but each bar is divided into sub-sections stacked vertically, where each sub-section is a sub-category within the main category.

Purpose: stacked bar charts show how parts contribute to a whole across categories — for example, how a district’s cultivated area splits between the Kharif and Rabi seasons for each crop.

25.2.1 R Code


25.3 Multiple (Grouped) Bar Chart

Structure: multiple bar charts feature separate bars for each sub-category, placed side by side rather than stacked, across the same set of categories.

Purpose: grouped bar charts are ideal for comparing multiple sub-categories across the same main categories — for example, comparing this year’s and last year’s yield for the same set of crops.

25.3.1 R Code

Each type of bar chart serves a different purpose: simple bars compare single totals, stacked bars show how parts add up to a whole, and grouped bars compare sub-categories side by side across the same main categories.


Summary

Concept Description
Bar Charts
Simple Bar Chart Compares the magnitude of a single value across categories, e.g., total production by crop
Sub-divided (Stacked) Bar Chart Stacks sub-categories within each bar to show how parts contribute to a whole, e.g., area by crop and season
Multiple (Grouped) Bar Chart Places sub-category bars side by side to compare them directly across categories, e.g., yield by crop, year over year