Cookies on ons.gov.uk

Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.

We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.

You have accepted all additional cookies. You have rejected all additional cookies. You can change your cookie preferences at any time.

Skip to main content

Chart details Ordering in charts

Overview

When showing the categories in a chart, for example, on an axis or in a legend, always plot them in a logical order. This will make your chart clearer and easier to read.

Ordering categories in a chart

If your chart axis has distinct categories, for example, in a bar chart, sort the categories by their value. This makes it easier for users to compare categories.

Categories and bars should not be ordered alphabetically, as they are in the following example:

Instead, sort the bars or categories by value from highest to lowest, as they are in the following example:

This helps users to compare the differences between categories and better interpret the data.

Using a natural order

Some categories have a natural order such as age groups or income bands. Always use their usual or natural order.

Categories with a natural order should not be sorted by data value, as they are in the following example:

Often with age groups we are looking at how the data change over time with age, and so removing the natural order makes it difficult to read and interpret the data trends.

Instead, categories with a natural order should be plotted in that usual order, as the age groups are in the following example:

Ordering specific categories

Totals and “other” or “did not answer”

If the dataset includes an aggregate category, like “total” or “UK average”, plot this first. Where possible, this should be separated from the rest of the categories.

If the dataset includes an “other” or “did not answer” category, plot this last.

In the following example, the categories are plotted in order from highest to lowest, except for the ”other address” category, which is plotted last:

Sex and gender

For data categorised by sex or gender, order the categories with female or women first and male or men second.

Read more about how to refer to sex and gender in our sex, gender and gender identity guidance.

Multiple time periods

For data from two or more time periods, put the older values before the newer values.

An exception is where you want to focus on the most recent period and are unable to emphasise this through custom colours.

Countries of the UK

When showing data for each of the nations of the UK, they should normally be in alphabetical order. Use the following order:

  • England
  • Northern Ireland
  • Scotland
  • Wales

Read more about how to write about different geographies in our countries and regions guidance.

Using more than more series

For some charts, for example, clustered bar charts, you may need to order categories that have more than one data value associated with them. In this case, choose the order that shows the most important trend you want to convey.

For example, a clustered bar chart or dot plot could have two values: the value for this year and the value for last year. In this case, you could order the categories by:

  • the current data to draw attention to the current picture rather than the change
  • the previous year’s data to draw attention to the change in the context of the initial value
  • their average
  • the difference between the two values to emphasise the amount of change; this can be unclear if the changes are relatively small

Stacked bar charts

In stacked bar charts, both the bars and the segments within them should have an order.

Segments in stacked bar charts

Sort the segments in a stacked bar chart, area chart, or pie chart in the same way as categories on an axis. This should be by data value, from largest to smallest, except where the categories have a natural order.

In the following example, the segments are plotted in value order, starting from the base of the stack with the largest category. The other category is plotted last, at the top of the stack. In this example, the order is based on the ranking of categories in the most recent period.

In the following example, the segments in the chart are plotted in their natural order, ranging from “very bad” to “very good”:

The segments should always be in the same order across all the bars in a stacked bar chart. If the ranking of categories is not consistent across bars, plot them according to:

  • the overall size of the categories across all the bars
  • the size of the categories in a particular bar (for example, the most recent date in a time series)

An exception is if you want to focus on the comparison of a certain category. In this case, plot this category at the start of the stack. This will make it easier to see differences within the chosen category. Do not do this for categories that have a natural order.

Bars in stacked bar charts

When sorting bars in a stacked bar chart by data value, order them by either:

  • the total size of the bar, where the bars are not of consistent size
  • the size of the first component or group of components

In the following example, the regions are ordered by total size of the bar from the highest to the lowest:

In the following example, the bars are ordered by the size of the first two categories combined, representing the percentage of “bad” and “very bad” health:

Charts with sub-groups

In some charts, for example, bar charts, you can place the categories on an axis into groups. You should order both the groups and the categories within the groups.

In the following example, the groups are ordered by the rate for that group, while the individual categories are ordered according to their ranking within the group. In each case, ‘”other” categories are plotted last.

Small multiple charts

A small multiple chart contains several repeated charts of the same type, showing the data for different groups or categories.

The order of the charts should follow the guidelines for ordering categories within a chart. Sort the categories by data value, from largest to smallest, except where the categories have a natural order.

If your release contains more than one small multiple chart with the same categories, use a consistent order.

There will be more than one value to sort the data by in a small multiple chart, such as:

  • the maximum value
  • the average value
  • the value in the latest period

Decide which value is the most important and relevant for your analysis and use this order for each small multiple you include.

In the following example, the regions are sorted from highest to lowest by the data value in the latest period (2022). This chart comes from a release focused on the current data trends.

Help improve this page

Let us know how we could improve this page, or share your user research findings. Discuss this page on GitHub (opens in a new tab)