
Maintain rectangular forms for your barsĪnother major no-no is to mess with the shape of the bars to be plotted. By cutting 90 points out of the vertical axis, a small 4-point difference can be exaggerated to look like a 1:3 ratio. A bar chart with a non-zero baseline or some other gap in the axis scale can easily misrepresent the comparison between groups since the ratio in bar lengths will not match the ratio in actual bar values. Not only does that baseline make it easier for readers to compare bar lengths, it also maintains the truthfulness of your data visualization. Best practices for using bar charts Use a common zero-valued baselineįirst and foremost, make sure that all of your bars are being plotted against a zero-value baseline. For a summary-based bar chart, group by the first column, then compute the summary measure on the second. For a count-based bar chart, just the first column is needed. Other times, data may come in its unaggregated form like the below table snippet, with the visualization tool automatically performing the aggregation at the time of visualization creation. Note that while the average payments are highest with checks, it would take a different plot to show how often customers actually use them.ĭata rendered as a bar chart might come in a compact form like the above table, with one column for the categories and the second column for their values. In the following example, the height of each bar depicts the average transaction size by method of payment. Other times, the values may be an average, total, or some other summary measure computed separately for each group. You can see from this visualization that there was a small peak in June and July before returning to the previous baseline. For example, the following plot counts pageviews over a period of six months. In its simplest form, the values may be a simple frequency count or proportion for how much of the data is divided into each category – not an actual data feature at all. These values can come from a great variety of sources. The secondary variable’s values determine the length of each bar. In contrast, the secondary variable will be numeric in nature. dividing by quarter into 20XX-Q1, 20XX-Q2, 20XX-Q3, 20XX-Q4, etc.) The important point for this primary variable is that the groups are distinct. In addition, some non-categorical variables can be converted into groups, like aggregating temporal data based on date (eg. Some categorical variables have ordered values, like dividing objects by size (small, medium, large). Examples include state or country, industry type, website access method (desktop, mobile), and visitor type (free, basic, premium). A categorical variable takes discrete values, which can be thought of as labels. The primary variable of a bar chart is its categorical variable. Since this is a fairly common task, bar charts are a fairly ubiquitous chart type. From a bar chart, we can see which groups are highest or most common, and how other groups compare against the others. When you should use a bar chartĪ bar chart is used when you want to show a distribution of data points or perform a comparison of metric values across different subgroups of your data. We can see from this chart that while there are about three times as many purchases from new users who create user accounts than those that do not create user accounts (guests), both are dwarfed by the number of purchases made by repeating users. The categorical feature, user type, is plotted on the horizontal axis, and each bar’s height corresponds to the number of purchases made under each user type.

This example bar chart depicts the number of purchases made on a site by different types of users. Bars are plotted on a common baseline to allow for easy comparison of values. Each categorical value claims one bar, and the length of each bar corresponds to the bar’s value.

Levels are plotted on one chart axis, and values are plotted on the other axis. What is a bar chart?Ī bar chart (aka bar graph, column chart) plots numeric values for levels of a categorical feature as bars. One of the most fundamental chart types is the bar chart, and one of your most useful tools when it comes to exploring and understanding your data.
