Bar Chart

Learn how to draw a bar chart and its alternatives in Altair.

Bar charts are a popular way to visualize data, particularly for comparing values across different categories. Bar charts are used to display the data distribution, showing how frequently different values occur within a dataset. Bar charts can effectively display both quantitative and categorical data, and we often use them to highlight trends or patterns within the data.

An example of bar chart
An example of bar chart

When are bar charts useful?

Bar charts are useful when:

  • We want to compare values across categories or discrete values. For example, we’ll use a bar chart to compare the sales of different products, the number of job applicants by gender, or the average test scores of students in different grades.

  • We have a small number of ...