Bar

Bar charts compare values across categories, with one bar per item or several side by side or stacked.

LLMs

Usage

When a bar chart is the right choice, when another chart reads better, and how to draw one that tells the truth. The same rules hold in every chart library. For picking between chart types in general, see Choosing a chart.

What it is for

A bar chart compares one number across a set of separate categories: products, regions, months, teams. Each bar is a category, and its length is the value.

When to use

  • The reader asks which category is biggest, or by how much.
  • You rank items, such as the top ten pages by visits.
  • You compare two to four series per category, such as this year against last year for each region.
  • A total breaks into a few parts and the total matters most. Stack the bars.

Use something else when

  • The categories are many points in time and the reader wants the trend. Use a line chart.
  • You show how one measure is spread out, such as order values. Use a histogram, which bins a continuous range.
  • Each category has many observations and the spread matters. Use a box plot.
  • Zero is not a meaningful starting point, such as body temperature or a stock price. Use a dot plot or a line, which may start above zero.
  • There are dozens of categories of similar length. Use a lollipop chart, which is lighter, or show the top ten and a table.
  • There are one or two numbers. Write them in a sentence or show them as a statistic.

How it reads

Bars encode the value as length from a shared baseline. After position on a common scale, length is what people compare most accurately, which is why a bar chart is the default for comparing amounts. A pie chart encodes the same values as angle and area, which people read less accurately.

Do it well

  • Start the value axis at zero. A bar that starts above zero makes small differences look large.
  • Sort the bars by value, unless the categories have their own order, like months or age groups.
  • Use horizontal bars when the labels are long. Rotated labels are hard to read.
  • Label the bars directly when there are few of them, and drop the gridlines you no longer need.
  • Use one color for all bars. To make a point, give the one bar that matters an accent color and keep the rest neutral.
  • Keep the gap between bars smaller than a bar, and the bars of one group close together.

Pitfalls

  • A different color for every bar when color means nothing. It makes the reader look for a legend. Use one color.
  • Stacked bars where the reader must compare the middle segments. Only the bottom segment and the total share a baseline. Use grouped bars, or one small chart per segment.
  • More than about four series in a group. The groups turn into noise. Split them into small charts side by side.
  • 3D bars and shadows. They change the apparent length.
  • Bars bent around a circle. Outer bars look longer than inner bars with the same value.

Variants

  • Vertical: the default, and the natural fit for time periods.
  • Horizontal: for long labels and for rankings read top to bottom.
  • Grouped: two to four series side by side in each category.
  • Stacked: parts of a total, when the total matters more than each part.
  • 100% stacked: shares of a total, when the shares matter and the totals do not.
  • Diverging: values above and below zero, such as gains and losses.
  • Waterfall: how a start value becomes an end value through gains and losses.

Compared with similar charts

  • Against a line chart: bars compare separate values, lines show a trend between them. With more than about twelve time periods, use a line.
  • Against a pie chart: bars show the same shares more accurately. Keep a pie for two to five parts of one whole.
  • Against a lollipop chart: the same reading with less ink, which helps with many categories.
  • Against a histogram: a histogram has touching bars over a continuous range. A bar chart has gaps between separate categories.