Introduction
This guidance is for producers of official statistics who need to design data visualisations that are informative, consistent and easy to understand. It explores principles and approaches for presenting statistics effectively and looks at the use of colour and accessibility.
The guidance does not cover dynamic or interactive visualisations. However, the principles outlined are generally applicable in those contexts. This guidance has been designed to allow you to focus on areas of interest or importance to you rather than necessarily reading in one sitting.
Aims of this guidance
- Encourage people to follow established good practice
We want to ensure that across government, we follow good practice when producing data visualisations. This guidance brings together good practice from a range of existing sources and provides references for further reading.
- Help people tell the statistical story
It is our responsibility to ensure that important patterns and trends in statistics are clearly described and easy to see. Any statistics presented in graphs and tables must be presented impartially. It is our role to give insight and show users what the numbers mean. To do this effectively we must choose appropriate visualisations to convey the messages in our numbers.
- Improve consistency across government
We need to ensure that we use data visualisations consistently across government. This guidance provides principles to help ensure that we get the basics right.
- Ensure accessibility for all
We must produce visualisations which meet accessibility requirements. This ensures that the information we produce is available and helpful to the widest possible audience. This guidance gives advice on how to ensure your graphs meet accessibility criteria.
The basics of graphs
A graph is used when you want to show patterns, trends and relationships in the numbers.
Graphs are an excellent way to tell a memorable story or to summarise something complex. They can reveal insight that would be hidden if the statistics were presented in a table.
Graphs can also be used to quality assurance data and highlight errors or outliers in your data.
Graphs are often copied and re-used in other publications, news stories or social media posts. Graphs need to make sense if seen out of context of the original publication.
Things to include with your graph
- Title
Give the graph a meaningful title. Even if the graph is then removed from its original context, the user will know what it shows. Use a concise descriptive title that summarises the main message in the graph and, if necessary, put the more formal statistical title underneath it.
- Source
Include the source of the statistics underneath the graph.
- Axes
Label the axes so it is clear what the graph is showing. Horizontal labels are much easier to read and interpret than vertical or diagonal ones. Place the vertical axis label on the top of the axis.
- Annotations
Consider placing annotations inside the graph, if this helps to tell the story. Annotations can be used to highlight key features, provide context and avoid misinterpretation.
Good practice example: annotations
Source: Office for National Statistics
Keep it simple
Some graphing packages turn on unnecessary chart features by default. These distract from the story you’re trying to tell. You should aim to simplify your graph, focusing on the story for your users. Simplify the graph by maximising the “data-to-ink” ratio. Only add formatting details necessary for users to understand the data.
Some common “chart junk” includes:
- shaded backgrounds
- borders
- boxes around legends and other content
- patterns, textures and shadows
- 3D shapes
- data markers on line charts
- thick or dark gridlines
Bad practice example: maximising data to ink ratio
Source: Office for National Statistics
Good practice example: maximising data to ink ratio
Source: Office for National Statistics
Chart size
A graph should form part of the natural flow of content. The user should be able to take in a graph at a glance. For digital content, they should not need to click, scroll or enlarge a graph to view it effectively.
When a graph is too big, it interrupts the eye’s journey through the page. Over-sized graphs may be perceived as being unprofessional. If the graph is too small, the font will be hard to read and users might find it difficult to see what the graph is showing. Graph text should be about the same size as the body text around it, with the title a little larger.
Choosing the right graph
The right graph depends on the type of statistical relationships within your data. There are nine types of statistical relationship highlighted in the Financial Times Visual Vocabulary.
Relationship | Example | Recommended chart types |
---|---|---|
Distribution | Population by age | Bar graph, population pyramid, box plot, dot plot |
Time series | Price inflation over time | Line graph, calendar heat map |
Ranking | Schools ranked by performance | Bar graph, lollipop chart |
Deviation | Rail company performance compared with target | Bar graph |
Correlation | Relationship between weight and height | Scatterplot, line graph |
Magnitude | Average income by region | Bar graph |
Spatial | Geographical clusters of notifiable diseases | Map |
Part-to-whole | Total conomic production by industrial sector | Pie chart, donut chart, tree map, bubble chart |
Flow | Trade between countries | Sankey graph |
For any statistical relationship there are usually several graph options. What works best will depend the values in your data and the statistical story you’re telling. We recommend you try out different options. Look critically at how well each graph works for the situation and test different options with users and colleagues.
Bar graphs
Bar graphs are very versatile. They work well for comparing the magnitude of different categories. Bar graphs can also be used to show time series, ranks, part-to-whole, deviation and distribution.
Vertical and horizontal bars
Bar graphs can have either horizontal or vertical bars.
Good practice example: bar graph with vertical bars
Source: Office for National Statistics – International Passenger Survey
Horizontal bar graphs are useful when you have lots of categories or long category labels that do not fit under vertical bars.
Good practice example: horizontal bar graph with long category names
Source: Office for National Statistics – Annual Population Survey
Gaps between bars
The gap between bars should be slightly narrower than the width of a single bar. For clustered bar graphs, the gap between the clusters should be slightly wider than a single bar.
Value labels
If you find yourself labelling individual bar values, consider using a table instead. If you do add bar values, make sure the labels are aligned at the bottom of the bars. This will enable easy comparison.
Good practice example: labels on bar graph
Source: Office for National Statistics
Another option if you want to add values to your chart is to use a spark line graph. Spark lines combine a table and a graph.
Good practice example: spark line graph
Source: Office for National Statistics
Axes
The y-axis on a bar chart should always start at zero. The length of bars relative to the axis gives an instant understanding of the relative sizes of categories. Even if the axis is clearly labelled and a break signalled with a gap, the relative size is still conveyed very strongly on a bar chart and can mislead users.
If starting the y-axis at zero stops you from telling the story clearly, consider an alternative chart, such as a Cleveland dot plot.
Good practice example: starting a bar graph y-axis at zero
Source: Office for National Statistics – Annual Population Survey
Line graphs
Line graphs work well for presenting time series. Line graphs are also used to show distributions and ranks (using simple slope charts).
Labelling lines
When you can, label lines directly rather than using a legend. If a legend is unavoidable, place it near the lines within the body of the graph.
Good practice example: labelling lines directly
Source: Office for National Statistics – Marriages in England and Wales
Multiple series
It can be difficult to differentiate lines on the line graph if you have lots of categories. Textures, colour and marks are all options, but it is essential that the graph is not cluttered and is still accessible. Additionally, users may assign meaning to different colours or textures. For example, textured lines are primarily used for projections, forecasts or targets.
If you have multiple time series to display, one option to use small multiple charts. These are also called “panel charts” or “lattice plots”. If you use small multiple charts, it is essential that all the y-axes have the same scale to avoid misunderstandings.
Good practice example: small multiple charts
Source: Office for National Statistics
Breaking the y-axis
It is acceptable, with clear labelling, to break the y-axis on a line chart. As line graphs are not read in the same way as bar charts, breaking the axis does not mislead in the same way.
Aspect ratios
The aspect ratio (ratio of width to height) of your line chart can alter the slopes of a line graph. This could be misleading. It has been proposed that the average slope in a line chart should be 45°. This is referred to as “banking to 45°”.
Quality of underlying data
You should consider the quality of the statistics before creating a visualisation. Avoid focusing too closely on a volatile series. When there is a substantive point in the scale, such as a policy target or, for an index, the “100%” line, always include it.
If you are describing a substantial relative change in a series, like a halving of a rate, it makes sense to include the zero in the chart to reinforce that point.
Pie and donut charts
Pie or donut charts work best for showing part-to-whole relationships. These charts clearly show that the “parts” add to the “whole”.
Good practice example: pie chart
Source: Office for National Statistics – Household Labour Force Survey
In donut charts, the central space is a convenient place to show the value of the total. Clear, concise labelling can be a challenge with donut charts.
Good practice example: donut chart
Source: Office for National Statistics – Household Labour Force Survey
Bar charts can also be used for part-to-whole relationships, but do not give the same immediate indication of each part adding up to the whole.
Use a pie chart or donut chart for part-to-whole:
- if there are five or fewer categories
- if the differences between categories are not significant
- to break up a page of bar graphs
Use a bar graph for part-to-whole:
- to accurately show small differences across categories that would not be obvious in a pie chart or donut chart
- when there are more than four or five categories
Stacked bar graphs
Stacked bar graphs are an alternative way of presenting part-to-whole relationships. These work best for ordinal data.
It is important to consider whether a stacked bar graph is appropriate for your data. In this graph, the sections at each end of the stacked bars, the size of the section and comparisons with neighbouring bars are clear. However, for sections in the middle, without a common horizon, this is much more difficult.
The impact of this will depend on whether the outcome variable is categorical or ordinal. For an ordinal variable, each level of the stack has a meaning and can clearly be compared.
Good practice example: stacked bar graph
Source: Office for National Statistics – Annual Population Survey
Tables
Tables are used to present numbers in a clear and systematic way.
Table or graph?
It is harder for readers to see patterns in tables than in graph. Use a graph when you want to show patterns, trends and relationships in the statistics, where the actual values are not required to make the point and values share the same units.
A table can be more appropriate if:
- you are asking the reader to compare individual values
- you want to include the values and derived measures such as percentages or indices
- you want to include summary statistics such as means or totals
- you need to show values with very different magnitudes in the same display, for example values in the tens and values in the millions
- users want use the data in their own analysis
Demonstration tables
If we are using a table to demonstrate a point that we are making in the text, we create a demonstration table. These lay out statistics to quickly reinforce the point.
Good practice example: demonstration table with supporting commentary
The UK population, which was 66.4 million in mid 2018, is projected to rise to 69.4 million over the decade to mid 2028. It is then projected to pass 70 million by mid 2031 and reach 72.4 million by 25 years into the projection (mid 2043).
Figures may not sum because of rounding
Source: Office for National Statistics – National population projections
Reference tables
Reference tables usually have lots of rows and columns of data and are aimed at users who need or want detailed data. There may be a wide variety of statistics broken down into different categories.
It is best to provide these complex reference tables in an appendix or accompanying spreadsheet. Because of the volume of data, it’s essential that the table design allows users to identify the right statistics with minimum effort. The guidance on releasing statistics in spreadsheets provides further advice on designing reference tables.
Good practice for tables
Comparing numbers
If you are inviting users to compare numbers, ensure that those numbers are presented close together. It is easier to make comparisons and determine patterns when numbers are arranged in a column instead of a row.
To help the reader make comparisons:
- use the same level of precision in each column
- use commas to separate thousands
- right align the figures and the column headings
- start numbers of less than one with a zero, not a point
Rounding
Presenting too much detail can make things harder for users. Simplifying numbers by rounding makes numbers easier to read and remember (PDF, 91KB).
The extent of rounding will depend on the intended use. A journalist may be happy to report that the population of the UK is 66 million, or that the population has changed from 64.1 million to 66.4 million. An analyst performing further calculations will want to work with more precise figures.
Rounding does reduce precision. This usually means that the reported totals no longer equal the sum of the component parts. While demonstration tables should present suitably rounded numbers to illustrate the point being made, reference tables usually retain most or all of the precision.
Making a decision on rounding can be difficult when the values show a variety of magnitudes. Consider rounding to a fixed number of significant figures or effective digits.
Grid lines
Grid lines help to separate parts of a table or group together related items. However, excessive use of grid lines clutters the page and interrupts numerical comparisons.
Grouping
Objects grouped together are assumed to be associated. Different measures can be grouped in rows and different types of estimate in columns.
White space
White space can be used to separate the data into groups. Sub-groups can be indented to show hierarchy.
Good practice example: using white space to separate groups of data
Source: Office for National Statistics
Ordering categories
Ordering the categories in a table can make it easier for users to see patterns and groups in the data.
For some categorical variables, like month of the year or age group, there is a natural order for presentation. Other variables may have harmonised ordering, such as regions of the UK.
Use natural or harmonised principles whenever possible. An appropriate order may also be obvious from knowledge of the subject matter.
Alternatively, consider ordering categories according to the statistics in one of the columns, for example the largest value at the top. This shows the rankings of the categories on that statistic, and may also show where some of the statistics differ from the overall pattern.
Ranking the categories in this way emphasises the relative positions of the categories. It may also show where some statistics differ from the overall pattern. Be aware that in some cases, the relative positions may be determined by random variation.
Summary rows and columns
Summary rows and columns, for example for totals, are traditionally placed at the bottom or right of the table. If it’s important for users to see totals first, it may be helpful to place the totals at the top or left.
Titles and labelling
Titles and labels are important parts of the table design. They help ensure users understand the statistics presented even if the user does not read the accompanying commentary or if the table is copied and placed in another context.
Consider including the following information in the titles, labels, headings and footnotes that accompany the table:
- analysis units (people, households, enterprises etc)
- types of statistics (totals, rates, means, etc)
- units (thousands, km, £, etc)
- classifications used to categorise the data
- geographical coverage
- sector coverage
- time periods
- source of data
- key quality information
- where to find further guidance
Fonts
Use a single, accessible font. We recommend sans serif fonts, for example Open Sans, Arial, Helvetica, Tahoma or Verdana. Only use bold font for headings and don’t use italics.
Keep changes in font size to a minimum and don’t use very small fonts. In general, we recommend a minimum font size of 12.
Accessibility
Everything that we produce in government should be as inclusive as possible and this includes our graphs and tables. Detailed information on accessibility can be found on the Government Digital Service (GDS) website.
We want to make sure our content is accessible to everyone, including users with impairments to their:
- vision – for example: severely sight impaired (blind), sight impaired (partially sighted) or colour blind people
- hearing – for example: people who are deaf or hard of hearing
- mobility – for example: those who find it difficult to use a mouse or keyboard
- thinking and understanding – for example: people with dyslexia, autism or learning difficulties
Making tables more accessible
- Use column headers which explain the content of the columns.
- Include derived variables at the end of columns or rows.
- Try to use more rows than columns – a tall, narrow table is easier to read than a short, wide one.
- Write out acronyms in full or clearly explain them.
- Put the key statistics at the top or in the first few columns of the table.
- If you do not need to use exact numbers, consider rounding large numbers with decimal places.
More comprehensive information on making tables accessible can be found on GOV.UK.
Making graphs more accessible
- Write out acronyms in full or clearly explain them.
- Do not use red and green together, as it is difficult to distinguish between them.
- Make sure there is clear distinction between different lines.
- Always include alternative text (alt text) for any graphs saved as images.
Colour
Colour can fundamentally change how we see the information in graphs and tables. Colour used well can enhance and clarify statistical content. Colour used poorly will confuse our users (PDF, 391KB).
This section sets out key principles for using colour in graphs and tables. It provides examples of the application of these principles in practice.
“Avoiding catastrophe becomes the first principle in bringing colour to information. Above all, do no harm.”
R. Tufte, Envisioning information, Connecticut: Graphics Press, 1990.
We add colour to make graphs and tables more effective. However, this only works if users can:
- tell which colour is which (identification)
- tell the difference between distinct colours (discrimination)
The way the brain perceives colour and the context in which the colours are used also affects our ability to identify and discriminate colours.
Tips for using colours
Tip 1: use colour sparingly and with restraint
Colours are most effective when they are not overused. Limiting colour increases its impact by drawing on the brain’s ability to highlight differences quickly.
Think carefully before you introduce additional colours into a graph or table. Do you really need the colours? Do they enhance the clarity of the message that you want to get across?
Never use colour to specify something on its own. People often print documents in black and white. Some people are colour-blind. It’s important not to rely on colour alone to add meaning to your data.
Use different colours only when they represent helpful differences of meaning in the data. When people look at a visualisation with multiple colours, they try to determine the meaning of those different colours. Suggesting meanings which aren’t there makes the user waste time and effort trying to understand them.
A graph using a single colour is more effective. The user is much more likely to compare the bars when they look alike than when they look different.
Good practice example: colour use in graphs
Source: Office for National Statistics, E-commerce survey of United Kingdom (UK) businesses
Tip 2: ensure colours are accessible
Colour blindness affects the ability to distinguish between colours. Colour blindness affects about 1 in 12 men and 1 in 200 women with varying levels of severity.
The most common forms of colour blindness affects people’s ability to distinguish between reds and greens. To minimise the impact on colour blind users, avoid using greens and reds in the same display.
A user with red-green colour blindness will struggle to discriminate between the red and green bars. In addition, red-green colour palettes may not be clear when printed in greyscale.
A safe starting point is a blue palette, where the colours are optimally distinct from one another.
Tip 3: choose colours carefully
We usually choose colours based on a combination of three factors:
1. Graphic design
Illustrators or designers may prefer particular colour combinations. Organisations’ house styles provide specific palettes.
2. Cultural context
Colours can have cultural associations. We react to these consciously and unconsciously. These associations vary widely across countries and groups.
Research shows that using colours that people associate with familiar concepts, such as blue for water, can improve the quality and speed of information processing. Counter-intuitive colours (PDF, 482KB), such as red for grass, do the opposite.
Think about whether your choice of colours could have a cultural association. Remember that cultural associations only work for the groups that know about them. Is using such colours appropriate in the context of the information that you are presenting?
3. Science
Biological and psychological knowledge can help us to design colour schemes that take account of how the human brain and visual system process information. This can improve the usability of graphs and tables.
Tip 4: understand the digital colour palette
Colours are represented digitally using several common schemes.
For our purposes, the most useful of these is the Hue-Saturation-Luminance (HSL) model. HSL allows us to define colours uniquely using three properties which are fairly intuitive:
1. Hue
Hues are colours. For example, red, blue or yellow. Hues do not have an agreed natural order. Therefore, users may have difficulty in assigning a logical order to them.
Small changes in hue are easy to detect – but colour blindness can have an impact on how well people can see these changes.
2. Saturation (chroma)
Saturation is the intensity of colour. It varies from grey or white (no saturation at all) to rich, glowing colour. Saturation is perceived on a continuous scale, but small changes are hard to detect.
3. Luminance (lightness)
Luminance is the brightness of colour. It is perceived as a continuous, ordered scale from dark to light. This natural order can help us to optimise colour schemes for maximum distinction and differentiation.
Changes in luminance are easy to detect. Humans can rank levels of luminance quite well unless the change is very subtle. How we perceive luminance depends on hue.
It is easy to distinguish between the bars even if the only changing colour parameter is luminance. Changes in luminance of 10 to 20 per cent are enough to distinguish shades in bar graphs, pie and donut charts. Changes of 30 to 40 per cent are needed to achieve the same effect in line graphs, because the lines are separated by white space.
Tip 5: never use an image as a backdrop
Never use images as backdrops in graphs or tables. These distract the user and make it more difficult to see the data clearly and pick up the important messages.
Maps sometimes include backgrounds such as aerial photography or Google Map data to provide context. If you do this, take care to ensure that the messages of your map are not obscured or compromised by the additional complexity of the background.
Tip 6: know how to use colour effectively
- Alternate colours
Consider alternating dark and light colours for categorical data to improve clarity and differentiation.
Good practice example: alternating colours
- Use borders
Adding thin borders to the edges of bars can also enhance clarity. Using a dark tint for the edges of light bars makes them stand out more.
Good practice example: thin borders to bar edges
- Avoid overuse of saturated colours
Mid to low levels of saturation are easy on the eye. High levels are bright and vibrant. Only use bold, saturated colours when you want to draw attention to a specific piece of information or to small, hard to see elements like points on a graph. Avoid using them for all the colours in a graph or to cover large expanses.
Lots of saturated colour reduces impact and clarity. If all the colours in a graph are bold, this can destroy any logical visual hierarchy in the data. Saturated colours like this are best left for highlighting key messages.
Bold, saturated colours have a powerful and dramatic impact. This can include unsettling visual side-effects. They may appear to glow for many users, can generate after-images and their presence can affect how colours viewed subsequently or nearby appear.
Good practice example: medium saturation
For point and line graphs, experiment with colours of medium saturation to see if you can achieve an effective result before resorting to bold, saturated ones.
Do not use saturated colours to highlight information in a table.
- Use colour logically and consistently
For sequences of colours, ensure that these progress in a way that the user would expect (e.g. in luminance order). When representing a sequence, use a single hue (or small set of closely related hues) and vary lightness from pale colours to dark colours, rather than alternating.
Make sure that your use of colour is consistent and logical. Use the same colour to mean the same thing in a series of graphs. Changing what colours represent in a sequence of graphs or tables increases the user’s cognitive workload. It can also cause them to mistake one data series for another, especially if skim reading.
Where possible, use colours that users would expect to see to represent familiar concepts, but remember the complications around cultural associations. Using unexpected colours to represent familiar concepts (such as red for grass) slows down information processing and forces the user to work harder. These effects are small and subtle, but do accumulate.
- Be careful when using colours on line graphs
Graphs with more than four lines are often hard to follow, even with variations in line texture. Introducing additional colour will not solve the problem. A better approach to visualise five or more lines is to use a “small multiples” plot (also known as a lattice or panel chart), which picks out variations in the different series at a glance.
- Use colour to highlight
Colour can be used to highlight elements of graphs and tables to aid interpretation.
In graphs, use a distinct foreground colour to draw attention to specific features. Muted pastel or grey shades can be used to reduce the impact of the other elements in the graphic.
Good practice example: highlights
Carefully chosen background colours can improve the clarity of printed tables by highlighting particular rows or columns. Use subtle shades rather than bold, saturated ones for highlighting in tables.
Don’t overdo highlighting, particularly if the tables will be printed. It is best to restrict this to one or two columns. For digital content, you should not use colour to highlight values in tables.
- Use a white background
Effective use of colour applies as much to graph annotation and background as it does to data elements like bars and lines.
Most colour palettes are designed to appear on a white background. In general, background colour should be avoided completely in tables unless it is to provide subtle highlighting in a limited subset of cells in a printed table. Background shading does not work well in digital content.
Human vision adopts colour perception relative to the local definition of white. A white background provides a helpful reference “anchor” for the visual system.
The only functional reason to use a non-white background is for viewing the image in the dark. The use of modern digital projectors, which work well under normal lighting conditions, make this issue largely irrelevant today.
Confine use of colour to foreground items in graphs. Use grey palettes for drawing and labelling axes.
Avoid using white as a foreground colour in graphs. It should also be avoided on maps unless it represents zero, “no data” or the centre of a diverging distribution.
Resources
Resources that complement this guidance:
- Effective maps in official statistics
- Ferdio – find the right visualisation and get inspired how to make them.
- Perceptual Edge – includes example of bad practice and how to improve
- Financial Times visual vocabulary (PDF, 3.7MB)
- Information Is Beautiful – making clearer, more informed decisions about the world
- Office for National Statistics blogs on data visualisation
- Office for National Statistics Style.ONS guidance on data visualisation
- The Graphic Continuum
- United Nations Economic Commission for Europe, Making data meaningful Part 2: A guide to presenting statistics
- Visualising data
- Flowing data
- Brewer palettes on Martin Krzywinski’s website
- Colorbrewer colour advice for maps
- NASA Ames Research Laboratory colour usage guidance
- Frequently asked questions about colour
- Generate colours for data visualisation
- How to pick more beautiful colours for your data visualisations
- Colour contrast checker
- Convert colour codes: HEX, RGB, HSL and CMYK