A bar graph compares values across categories using rectangular bars. The longer or taller the bar, the larger the value it represents. You can use one to compare sales across regions, count support requests by team, or see which product has the most customers.
Bar graphs are easy to recognize, but their usefulness depends on how you organize the data. A simple chart can show which category leads, while grouped and stacked bars let you compare multiple measures or see how totals are divided. Choosing the wrong layout can make those comparisons harder than they need to be.
This guide covers the main types of bar graphs, how to read them, when to choose another chart, and how to make one from your own data. We'll also use interactive charts built in Deepnote to show how these comparisons work with real data.
What is a bar graph?
A bar graph, also called a bar chart, represents categories as rectangular bars whose lengths or heights correspond to numerical values. Each bar stands for a group, such as a product, department, or survey response.
For example, a bar graph of support requests would place each team on the category axis and show its request count with a separate bar. Readers could identify the busiest team without checking every number in a table.
Bar graph key components & parts
A bar graph has four key components:
- Category axis: Identifies what each bar represents, such as a region or product.
- Value axis: Shows the numerical scale used to measure the bars.
- Bars: Encode each category's value through length or height.
- Title and labels: Explain what is being compared, including the units and time period where relevant.
Vertical vs. horizontal bar graphs
The two orientations show the same information. The difference is how readers encounter the categories.
A vertical bar graph, sometimes called a column chart, places categories along the horizontal axis and values along the vertical axis. It works well when category names are short or when the categories follow a natural sequence, such as months.
A horizontal bar graph places categories on the vertical axis and values on the horizontal axis. It is usually easier to read when categories have long names or need to be ranked from highest to lowest.
The Palmer Penguins dataset provides a simple example. It contains 152 Adelie, 124 Gentoo, and 68 Chinstrap records. The charts below show those counts in both orientations, keeping the category order and numerical scale consistent.
Adelie has the largest count in both views. The vertical version works comfortably with these short species names; the horizontal version presents the ranking from top to bottom. For longer category labels, such as full product or department names, horizontal bars leave more room to read the text without rotating it.
Bar chart use cases
Bar charts work best when the question involves comparing a numerical measure across distinct categories. These are some of their most useful applications:
Use case | Example question | Suitable layout |
|---|---|---|
Rank categories | Which products generated the most revenue last quarter? | Horizontal bars sorted by revenue |
Compare workloads | How many support requests did each team receive this month? | Simple bars showing request counts |
Compare groups within categories | How do new and returning customers’ purchases differ across regions? | Grouped bars |
Compare results with targets | Which departments stayed within their quarterly budgets? | Grouped bars showing actual and budgeted amounts |
Show totals and their composition | How many tickets did each team receive, and which issue types contributed? | Stacked bars |
Compare proportions | How does the mix of positive, neutral, and negative survey responses differ by customer segment? | 100% stacked bars, with response counts shown alongside |
Use consistent definitions, units, and reporting periods across the categories. When groups differ in size, a rate may be more useful than a total: support requests per 1,000 customers answers a different question from total support requests.
When not to use a bar graph
A bar graph is not always the clearest choice.
For a long time series, use a line graph when the trend is more important than each period's separate value. For individual measurements with a wide spread, a histogram or box plot can reveal information that a bar graph of averages would conceal.
If your data contain many categories with long labels, first try horizontal bars and sorting. If there are still too many categories to compare meaningfully, consider grouping them or focusing on a relevant subset rather than fitting every value into one chart.
Types of bar graphs
The main types of bar graphs differ in how many measures they display and whether they emphasize totals or comparisons between groups.
Simple bar graphs
A simple bar graph uses one bar per category to show a single measure, such as revenue by product or the number of requests handled by each service.
The Palmer Penguins dataset contains observations of 344 penguins from three species. Counting the records by species produces:
Species | Recorded penguins |
|---|---|
Adelie | 152 |
Gentoo | 124 |
Chinstrap | 68 |
Adelie penguins account for the largest number of records in this dataset, followed by Gentoo and Chinstrap penguins. Each bar represents a species, and its length shows how many observations belong to that category.
The chart compares records in this particular dataset. It does not estimate the total wild population of each species.
Grouped or clustered bar graphs
A grouped bar graph places two or more bars side by side within each category. The separate bars represent another variable, usually distinguished by color.
Suppose we want to examine how the penguin species are represented across three islands. Instead of showing one total per species, we can count the observations for each species-island combination.
The dataset includes 44 Adelie and 124 Gentoo penguins on Biscoe Island. Dream Island contains 56 Adelie and 68 Chinstrap records, while all 52 Torgersen records are Adelie.
Side-by-side bars make it possible to compare species within an island and track the same species across islands.
In business reporting, the equivalent might be monthly revenue for two products, support requests handled by different teams, or performance across experiment groups.
Grouped bars work best with a limited number of series. If every category contains six or seven bars, the chart becomes crowded and the legend becomes harder to follow.
Stacked bar charts
A stacked bar chart divides each bar into colored segments. Each segment represents part of the category's total, and all segments together determine the bar's overall length.
Using the penguin records again, we can create one bar for each island and stack its species counts.
Biscoe has 168 recorded penguins, Dream has 124, and Torgersen has 52. The complete bars make these totals visible, while the colored segments show how much each species contributes.
Stacked bars are useful when both the total and its composition matter. A product team might use one to compare support tickets by issue type across releases. A finance team might use another to show revenue contributions from different product lines.
The main limitation is segment comparison. Only the segments attached to a common baseline are easy to compare precisely. Segments higher in the stack start at different positions, making small differences harder to judge.
If the goal is to compare one component across several categories, grouped bars may work better.
100% stacked bar charts
A 100% stacked bar chart scales every bar to the same length. Instead of showing absolute totals, it shows how each category is divided proportionally.
In the penguin dataset, about 74% of the Biscoe records are Gentoo penguins, while about 55% of the Dream records are Chinstrap penguins. Torgersen's records are entirely Adelie penguins.
This chart makes the differences in composition easy to see, but it hides an important fact: the islands have different numbers of recorded penguins.
Biscoe has 168 observations, compared with 52 on Torgersen. Both bars occupy 100% of the chart's scale despite representing different sample sizes.
Use 100% stacked bars when relative shares matter more than absolute totals. Show the underlying totals alongside the chart if differences in sample size could affect its interpretation.
How to read a bar graph
Start by identifying what the bars measure. Then examine the scale, categories, and differences between values.
- Read the title and units. A chart labeled "Revenue by region" is incomplete unless readers can tell whether revenue is measured in dollars, thousands, or millions, and for which period.
- Check the category axis. Identify what each bar represents and whether the categories have been sorted or placed in a meaningful order.
- Read the value axis. Confirm where the scale begins, how its intervals increase, and whether the values are counts, percentages, totals, or averages.
- Compare bar lengths. Longer bars indicate larger values on a consistent scale. Use the labels or hover values when the difference is too small to estimate visually.
- Check the legend and grouping. In grouped or stacked charts, colors identify separate series or components. Check whether you are comparing whole bars or individual segments.
Consider the species-count example above. Adelie has 152 observations, compared with 68 for Chinstrap. The difference is 84 observations, and the Adelie count is a little more than twice as large.
This comparison is straightforward because both bars use the same scale and represent counts from the same dataset.
A chart of average values needs more care. If one bar shows average revenue per customer and another shows total revenue, their lengths cannot be compared meaningfully, even if the bars look similar.
Bar graph vs. line graph: which should you use?
Both chart types compare numerical values, but they emphasize different relationships.
A bar graph makes individual categories easy to compare. A line graph connects values to show how something changes along an ordered axis, most commonly over time.
Question | Better choice |
|---|---|
Which sales region generated the most revenue? | Bar graph |
How did total revenue change over 12 months? | Line graph |
Which product had the most orders last quarter? | Bar graph |
How has daily order volume changed since launch? | Line graph |
How did five teams perform against their targets? | Bar graph |
Time does not automatically require a line graph. If you are comparing annual totals across four years, separate bars may be enough. If you need to examine monthly growth, seasonal changes, or sudden drops, a line generally communicates the pattern more clearly.
Imagine plotting daily support requests over six months. A bar graph with one bar per day would be difficult to read because of the number of categories. A line graph preserves the sequence of dates and makes trends easier to follow.
You can use Deepnote's line graph maker when the main question concerns change over time rather than individual category rankings.
The distinction also matters when values between recorded points are meaningful. Connecting unrelated categories, such as customer segments or product names, with a line can imply continuity where none exists.
Bar graph vs. histogram: what's the difference?
A bar graph compares categories. A histogram shows how numerical observations are distributed across intervals, called bins.
Suppose a product team records the response time of every API request. A bar graph could compare the average response time for each service. A histogram could show how many individual requests took 0–100 milliseconds, 100–200 milliseconds, and so on.
The bar graph answers which service has the higher average. The histogram answers how common different response times are.
Bar graphs usually separate categories with gaps and can reorder them. Histogram bins follow the numerical scale and usually touch.
Our histogram vs. bar graph guide demonstrates both using the same request dataset. If you want to investigate the distribution of measurements rather than compare category summaries, use the histogram maker.
Bar graph examples with real data
Public datasets are useful for understanding chart design because we can verify the values and explore how different summaries change the interpretation.
Example 1: Comparing penguin records by island
The Palmer Penguins dataset contains 344 observations recorded across three islands. Biscoe accounts for 168 records, Dream for 124, and Torgersen for 52.
The bar graph makes the differences in recorded observations easy to compare. Biscoe contributes the largest number of records, but these counts describe the research dataset, not the total penguin populations on each island.
Example 2: Comparing category composition across groups
The same penguin dataset can answer a different question when we group records by island and species.
A grouped chart emphasizes the number of records for each species on each island. A stacked chart emphasizes each island's total and the contribution from each species.
The underlying observations are unchanged. Only the grouping and display differ.
This is a useful principle for analytics work: decide whether the reader needs to compare individual components, whole totals, or proportions before choosing the bar layout.
Example 3: Comparing dataset sizes without overstating the result
The UCI Wine Quality dataset contains laboratory and sensory measurements for Portuguese red and white vinho verde wines. It includes 1,599 red wine samples and 4,898 white wine samples.
A bar graph of sample counts makes the imbalance immediately visible.
White wine accounts for roughly three-quarters of the 6,497 combined records.
This is useful information when analyzing or modeling the dataset. Overall results may reflect the larger number of white wine observations, so examining the variants separately may be important.
But the bar graph says nothing about which wine is better. It compares the number of records available, not their quality scores.
The distinction illustrates why a descriptive title matters. "Wine quality comparison" would promise something the chart does not show. "Number of samples by wine type" accurately describes the data.
How to make a bar graph
You can make a bar graph in a spreadsheet, with Python, or using an AI chart generator. Regardless of the tool, the essential steps are the same: prepare the categories and values, choose the right bar layout, and verify the resulting comparison.
Make a bar graph with Deepnote Agent
Deepnote’s bar graph maker lets you describe both the data preparation and the chart in one request. You can include values directly in the prompt or name a dataset that Agent can load through a Python library.
For this example, we’ll use Seaborn’s Palmer Penguins sample dataset. Instead of supplying the species totals ourselves, we’ll ask Agent to load the observations, count them, and check the result:
Load the Palmer Penguins dataset using
seaborn.load_dataset("penguins"). Count the records for each species and create an interactive horizontal bar graph.Count rows rather than nonmissing body-mass or bill measurements. Do not discard records because unrelated measurement columns contain missing values. Check for missing species labels and report any that you find.
Sort the bars from largest to smallest, with the largest at the top. Start the value axis at zero, use blue bars, and label each bar with its count. Label the axes “Recorded penguins” and “Species.” Title the chart “Penguin records by species.”
Show the calculated count table below the chart and verify that the species counts add up to all 344 records. Identify the source as Palmer Penguins, loaded through Seaborn, and note that these are dataset counts rather than estimates of wild populations.
The counts should be 152 Adelie, 124 Gentoo, and 68 Chinstrap records. Counting rows matters: excluding penguins with missing body measurements would change the totals even though those measurements are not needed for this chart.
A follow-up request can examine how the species are distributed across islands:
Count records by island and species, then create a grouped bar chart. Keep species colors consistent, include a table of the counts, and verify that the island totals add up to 344. Describe absent combinations as having no records in this dataset.
The notebook keeps the data-loading and counting steps alongside the visualization, so teammates can inspect the calculations and refine the comparison.
Make a bar graph in Excel
Excel provides both bar and column charts. Arrange your data with categories in one column and numerical values in another, select the range, and choose a suitable chart from the Insert tab.
You can then change the orientation, add data labels, and reorder the categories. Excel also supports clustered and stacked chart layouts.
For the complete walkthrough, including sorting, stacked bars, and formatting, see how to make a bar graph in Excel.
Common bar graph mistakes
Bar graphs look simple, which makes some errors surprisingly easy to miss.
Starting the value axis above zero
Bar lengths encode magnitude. If the value axis starts at 90 instead of zero, bars representing 95 and 100 can appear dramatically different even though their actual values are close.
A zero baseline generally preserves the intended proportional comparison. When small changes within a narrow numerical range are the focus, a line chart or dot plot may be better suited to showing them.
Our guide to misleading graphs includes examples of how axis choices can exaggerate differences.
Comparing totals from unequal groups
Suppose two product groups have different numbers of customers. Comparing their raw support ticket totals could suggest one product is less reliable, even though the difference may largely reflect customer volume.
You might need tickets per 1,000 customers or a comparable rate instead of raw counts.
Check the denominator before interpreting larger bars as worse performance.
Using stacked bars when exact comparisons matter
Stacked bars are effective for showing composition, but inner segments are harder to compare because they do not share a common baseline.
Use grouped bars when the primary question concerns differences between specific series.
Sorting categories incorrectly
Sorting categories by value helps readers scan rankings. But sorting months from highest to lowest would break their chronological order and make time-based patterns harder to understand.
Preserve a meaningful sequence when one exists. Otherwise, sort by a relevant measure.
Adding too many categories or series
A chart with dozens of narrow bars or many similar colors can become harder to read than the original table.
Choose the categories relevant to the question, group only when appropriate, and use separate charts when different comparisons deserve their own space.
Make your next chart from your own data
A useful bar graph starts with a specific comparison. Decide what each category represents, choose whether to show individual values or grouped components, and check that the scale tells the story accurately.
Use Deepnote’s AI chart generator to describe the comparison and provide the values, a connected source, or a dataset Agent can load. Ask it to calculate the category summaries, build the chart, and show the figures behind the bars.
For other visualization options, explore our guide to the 31 types of graphs and charts.