How to create a grouped bar chart
The bar chart is probably the most all-rounded chart type out there. But sometimes, your bars fall into categories (like continents, regions or countries, positive or negative growth or years), which you really want to show to make your statement. Grouped bar charts are perfect for that. In this tutorial, you will learn how to prepare and upload your dataset to create a grouped bar chart with Datawrapper.
If you want to create a simple bar chart in Datawrapper, please refer to our tutorial "How to create a bar chart".
Preparing and importing the data
Your data needs to be in a certain format for Datawrapper to create a grouped bar chart. You'll need three columns:
- Descriptive labels in the first column.
This will determine the label in front of each bar. In our case, these are the countries.
- Corresponding values in the second column.
These values need to be numeric in order to determine the length of each corresponding bar. In our case, the values are road fatalities.
- Categories in the third column.
With these categories, you decide what each bar will be grouped by. In our example, we chose to group the countries by continent.
|Country||Road fatalities per 100,000 motor vehicles||Continent|
Tips: These columns don't need to be in this exact order: Datawrapper will automatically plot the column with the numeric values; no matter if they're in the first, second or third column. Also, you can upload more than three columns and later choose which column you want to set as your labels, values, and groups. And the rows don't need to be in the exact order (you can sort them later).
Check & Describe
In the second step, you can check if your dataset was imported correctly and make changes to it - if necessary. If you don't have a header, you have to untick "First row as label" to avoid losing your first row of data. Always remember to do this if you don't have descriptive row and column headers.
By selecting a certain output locale, Datawrapper chooses the correct decimal and thousand separator for you.
Click on "Proceed" to get to the visualization process.
In this section, you have four tabs: "Chart Type", "Refine", "Annotate" and "Design". If Datawrapper did not automatically choose a bar chart for this data, you can click on the icon for "bar chart" in the upper-left corner of the "Chart Type" tab:
Now you will see your data in form of a bar chart – although not as a grouped bar chart yet. Since the tool can't be sure that you want a grouped bar chart, we will need to tell Datawrapper that. To do so, click on the tab "Refine". At the top of it, you'll see the feature "Customize axes". If it's not already open, click on it to open this feature and you will see the following options:
Here you can choose which of your columns should be shown as the values (the length of your bars), the labels (the text that's left to your bars) and the groups. The "Groups" field will be empty (--), but you can change that: Click on this drop-down menu to get a list of your columns; then choose the column you want to have your bars grouped by.