Menu Close Get Metabase

Master the bar chart visualization

Sep 29, 2020 by The Metabase Team

Metabase offers a large number of visualization settings. For this article, we’ll be discussing the bar chart option.

With bar charts you can compare groups of data with just a glance. One axis specifies the groups, while the other will quantify their count. The goal is to show big differences between the groups, such as which price points customers buy more of and which media platforms lead new customers to you.

In this article, we will cover creating a bar chart and bar chart settings.

Through editing our bar chart’s settings, we will transform the bar chart from Figure 1 into Figure 2.

Figure 1. Complete example of the initial bar chart.
Figure 1. Complete example of the initial bar chart.
Figure 2. The bar chart after all the settings changes have been made.
Figure 2. The bar chart after all the settings changes have been made.

Create a bar chart

Follow along with our bar chart walkthrough using Metabase’s Sample Dataset. Select “Ask a question” in the nav bar and create a Simple question using the Sample Dataset and its Product table.

Select the green “Summarize” button in the upper right corner. Scroll down the Summarize sidebar and select the “Category” column of the Product table.

Figure 2. Complete example of the bar chart.
Figure 2. Complete example of the bar chart.

This bar chart shows that while all categories of the Products table are purchased, doohickies are purchased a lot less than the other categories.

Bar chart settings

Click on the “Settings” button at the bottom left of the graph to alter the graph and achieve your desired aesthetic.

There are many settings you can use to customize your graph:

Though the settings sidebar opens to the data page, we have already selected the columns we want to show, so let’s continue to the next option. If your dataset had more columns, you could choose to add or remove different columns here.

Display

In the settings sidebar select the “Display” button.

The stacking feature is used to make complex bar graphs. Figure 7 uses stacking to display multiple categories inside of a small grouping.

Figure 7. Example of a stacked bar chart. Each layer of the stack is represented by a different color.
Figure 7. Example of a stacked bar chart. Each layer of the stack is represented by a different color.

Our example is a simple bar chart, so we don’t need the stacking feature.

You can add a goal line that specifies where you want numbers to be and Metabase can notify you when the graph raises or drops to that goal. In Figure 8 we add a goal line at 5000 and name it “Sales Goal.”

Figure 8. Adding a goal line to our example bar chart and renaming it 'Sales Goal.'
Figure 8. Adding a goal line to our example bar chart and renaming it 'Sales Goal.'

Toggling on show values places the count value above each column. The specific count value shows us precisely how close we are to achieving our goal in each category.

Clicking the color swatch at the bottom of the sidebar will open a color palette. Selecting a color swatch from the palette will change the color of the chart visualization and selecting one of the three display options will change the visualization. In Figure 8, we chose green.

Axes

Select “Axes” in the settings sidebar.

Here you can specify how you want your table organized.

Y-axis gives three options:

  • Linear
  • Power
  • Log

The linear option is selected automatically and for our example provides the most accurate representation of our data, so we’ll keep it.

With the show line and marks options you can change the the way the categories and quantities are represented on each axis. The options for the y-axis are hide and show, while the x-axis has several more:

  • Hide
  • Show
  • Compact
  • Rotate 45˚
  • Rotate 90˚

In Figure 9, we make three changes:

  • Tilt our x-axis category names on a 45˚ angle (for aesthetics).
  • Hide the y-axis numbers (the value is already specified on top of each bar).
  • Toggle off the auto y-axis range (to zoom in on the category count differences).
Figure 9. Changing the x-axis from straight on to a 45˚ angle and the y-axis we are zooming in and toggling off the values.
Figure 9. Changing the x-axis from straight on to a 45˚ angle and the y-axis we are zooming in and toggling off the values.

Labels

Select the “Labels” button in the settings sidebar.

Use the toggles if you don’t want certain axis labels or use the text boxes to enter the desired label for each axis.

“Number of Sales” is more descriptive than “Count,” so we change the label for the y-axis.

Figure 10. The y-axis is no longer 'Count' and is instead 'Number of Sales.'
Figure 10. The y-axis is no longer 'Count' and is instead 'Number of Sales.'

Learn more about your visualization options and discover drill-throughs with these articles: