How to create a stacked column chart

This guide will show you how to prepare your data to create a stacked column chart. This chart type is ideal to present proportions of categories, providing a very easy comparison. This is achieved by adding up constituent categorical dimensions. Each dimension will be represented by a part of a column and color-coded as well as sized accordingly. You can use a stacked area column to compare one year vs. another or reduce it to showing just one year in some cases. 

No matter how detailed your data is, the Datawrapper stacked column chart features an intelligent labelling function to avoid a cluttered visualization.

1

Preparing and importing the data

If you want to create this chart type, here's what you'll need:

  • One header row containing descriptive labels ("Spending", "2000", etc.)
  • One column with categories. These can be years, or other categories like regions, products, etc. 
  • At least two columns containing numeric values. The values in these columns will define the height of each bar segment. Each column will make one bar: We have four columns with six values each, so our chart will show four bars with six bar segments each. Since this is an absolute stacked column chart, the values do not have to add up to a certain value. If you are looking for a 100% stacked column chart, all values in one row have must add up to 100% (or 1).

Below is the data we used to create the chart at the top of the page: 

Spending 2000 2005 2010 2015
Government Pensions 0.5 0.7 1.0 1.2
Government Healthcare 0.5 0.8 1.1 1.4
Government Education 0.6 0.8 0.9 1.0
National Defense 0.4 0.6 0.8 0.8
Government Welfare 0.2 0.3 0.7 0.5
All other spending 1.0 1.2 1.4 1.5

Source: http://www.usgovernmentspending.com/breakdown

Once you prepared your data, create a new chart in Datawrapper. You can do so by going to our homepage and clicking on "Start creating". In Step 1: Upload, you can copy & paste your dataset, upload it as a .csv or as an Excel or Google Spreadsheet. After uploading, the text field in step 1 will look like this: 

Click "Proceed" at the bottom right to go to the next step.



2

Check & Describe

In the second step, you can check if your dataset was imported correctly and make changes to it - if necessary. If you did not upload a header row, 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.

In step 2, your data should look something like the figure below. You can see that Datawrapper correctly recognized your numbers as numbers (and not as text or dates) because they are colored in blue and are right-aligned. To learn more about the Datawrapper's automatic recognition of data formats, visit this article.

Click on "Proceed" at the bottom left to go to Step 3: Visualize.


3

Visualize

In this step and under the tab ''chart type'', you will see a list of the available chart types. Chances are that your data will automatically be displayed as a line chart. To change that to "Stacked Column Chart" , click on its symbol in the grid of available chart types:  

You will now see a stacked column chart, without a title, descriptions or customized colors. The next step would be to further refine, annotate & define this chart. We have covered customizing your stacked bar chart in a separate Academy article which you can read here.