Create a bar chart
You can follow along using Metabase’s Sample Database. Select + New > Question > Raw data > Sample database. Choose the Sample Database’s
Orders table as your data. Next, summarize the count of rows and group by Product -> Category. Your notebook should look like figure 1.
Click Visualize, and Metabase will present the data as a bar chart:
Bar chart settings
Click on the Settings button at the bottom left of the chart to see all our tools:
In the Settings > Display section, we can add a goal line that specifies where we want the values to be and Metabase can alert us when the values exceed (or drop below) that goal. In figure 3, we add a goal line at 5500 and name it
Arbitrary Sales Goal.
Toggling on Show values places the count values above each column.
Clicking the color swatch at the bottom of the sidebar will open a color palette to set the bar color.
We can also set the display to a stacked bar chart, which we’ll get into in a bit.
Axes in the Settings sidebar.
Here we can specify how we want our table organized.
Y-axis gives three options:
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 lines and marks options we can change 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:
- Rotate 45˚
- Rotate 90˚
Select the Labels button in the Settings sidebar. Here we can hide or customize axes labels.
Stacked bar charts
If the data we’re visualizing can be broken down into multiple categories within a whole, we could consider using a stacked bar chart. A 100% stacked bar chart is similar, but displays those parts as relative percentages, so every bar spans the full y-axis.
To create a stacked bar chart, click on Settings > Display and select either Stack or Stack - 100%.
Let’s say we wanted to see how many orders were placed per product category across different quarters of a year. Here’s that example displayed in three different bar chart styles:
It may take some back-and-forth to figure out which display settings are right for your data, so try a few different options to see what works best for you and your team.
Did this article help you?
Thanks for your feedback!