Stacking population data in bar charts with Report Builder

This article will try and show you some of the different ways you can use InstantAtlas Report Builder and the bar chart widget to present population data. We’re going to produce a few different charts, but we’re aiming for something like this:

5 year age bands grouped chart
5 year age bands, male and female chart with indicators grouped together

All of the examples in this post can be seen in the report at https://reports.instantatlas.com/report/view/0fcd2388dcb3401b86657a93f743b145/E07000200

The InstantAtlas national data service provides a wealth of data to help you create reports, dashboards and profiles for your areas of interest. However, with so much data available, presenting these data in a clear and informative way without overwhelming your audience can be tricky.

A common way to visualise population data is by using age bands. The two bar charts below show 5 year age bands for males and females in St Edmundsbury district, Suffolk.

5 year age bands males chart
5 year age bands, males, as a percentage of total male population
5 year age bands females chart
5 year age bands, females, as a percentage of total female population

This is one way to look at the data, but it doesn’t make it very easy to see how much each age band contributes to the whole population. For that we can start to use stacked bar charts:

5 year age bands stacked chart females
5 year age bands, females, stacked as a percentage of total female population

So how do we do that in Report Builder? When editing your report, you need to change the following settings:

Setting Value Why?
X Axis Label Format #NAME Makes the X axis have a simple label of the name of your current feature/area
Bar Orientation Horizontal Not essential, vertical works too, but horizontal often looks better with data like these…
Use Stacked Bars True (or “On”)
Binding Style Indicators As Series Switches the way data are assigned to either the series or the axis of the chart

(Another way of looking at population age bands could be to use a pie chart, but that’s a discussion for another time).

This sort of chart can be great for presenting age bands, but what if we want to compare male and females values in the same chart? What about if we just add all of the indicators ? The chart below shows our “first attempt”:

5 year age bands chart, stacked
5 year age bands, both male and female, stacked

Not very good. Too many “slices”, too few colours and almost impossible to compare the same age bands between male and female. To solve this we have to go into the Advanced settings of Report Builder and start grouping the indicators together and using indicator aliases to control what is shown in the legend and on the X axis. A few settings later and we get:

5 year age bands grouped chart
5 year age bands, male and female chart with indicators grouped together

To achieve this, we need to change a few settings. First, we alias the indicator names so that the chart “knows” they represent the same thing, just for different groups. So, using the indicator alias dialog, we change all the indicator names to a shortened version:

Indicator Alias
0 – 4 %
0 – 4 %
…and so on for all the indicators…

Now the chart can provide a common legend for all the “slices” in the chart. It also recognises that there are now repeating series, so it splits the stacked bars into two groups. The final step is to rename those groups and be specific about which group a series belongs to:

Setting Value Why?
Group Series By Names &Males=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
&Females=19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36
Labels each group on the X axis

(This is an Advanced setting, so you need to toggle those settings on in the dialog)

The &Males and &Females control both the labels and which indicators are in which groups (note that the. The values (=1,2,3,4…) are simply the indices of the indicators in the alias list – in this case they are very simple because the data is organised so that all the male indicators come first, then the females. You can flip the groups around or move indicators between groups by changing the index values.

You can open this report in edit mode with this URL: https://reports.instantatlas.com/report/edit/0fcd2388dcb3401b86657a93f743b145?clear=true – all the data is shared with everyone.

Keith Morrison

ESRI UK - InstantAtlas