Chart comparison / Comparison

Bar Chart vs Histogram

A bar chart compares named categories. A histogram divides a numeric range into intervals and counts observations within them. Decide what the horizontal axis means before choosing the mark.

Make the First Choice

Match the question and data to the chart
Question or detailChartWhat to check
InputBar ChartA category and an aggregate value, such as orders by channel.
InputHistogramNumeric observations, or interval boundaries with counts, such as order values.
OrderingBar ChartCategories may be ranked or follow a meaningful category order.
OrderingHistogramIntervals stay in numeric order and retain their widths.

WORKED EXAMPLE / ILLUSTRATIVE DATA

Two Questions About the Same Six Orders

Here is a small fictional order dataset. Each row includes a category and a numeric amount. Either chart can use these records, but each answers a different question.

Illustrative values for this example
OrderChannelAmount ($)
1Website12
2Store18
3Website24
4Marketplace27
5Store42
6Website48

For orders by channel, bar heights are Website 3, Store 2, and Marketplace 1. For order amounts in intervals [0, 20), [20, 40), and [40, 60), histogram counts are 2, 2, and 2. Both summaries use all six orders.

Do Not Decide From the Gaps Alone

Histogram rectangles commonly touch because neighboring intervals cover adjacent parts of a number line. Bar-chart gaps separate categories. Styling can blur that distinction, so inspect the input and axis meaning rather than relying only on appearance.

A zero-count interval still belongs in a histogram. Removing it closes a real gap in the numeric range. A category bar chart can show an absent category too, but its position is not a numeric distance.

Define Boundaries Before Counting

The notation [20, 40) includes 20 and excludes 40. Assign values on a boundary to exactly one interval. Document how the final upper boundary is handled so no observation is silently dropped.

If counts are already binned, plot those counts against their intervals. Passing the counts themselves into a histogram function creates a distribution of counts, which answers a different question. ChartTypes uses supplied bin counts and preserves them in each library preview.

A Numeric Label Can Still Be a Category

Bus route 12 and bus route 18 are identifiers. Their numeric labels do not make a histogram appropriate. By contrast, journey duration in minutes is a measurement that can be grouped into numeric intervals.

Keep the data table available so readers can see what was aggregated. If individual values matter more than the distribution, a dot plot or a compact table may be a better first view.

Before You Publish

  • Identify whether x represents categories or numeric intervals.
  • Check that every observation is counted exactly once.
  • Keep pre-binned counts separate from raw observations.

Explore Working Examples

Open a chart to inspect its sample data and compare code in six libraries.

Keep Exploring

Choosing a Comparison ChartChoosing a Distribution Chart