Jon Geraghty, dunnhumby’s data visualisation expert, looks at how more thought goes into displaying data than one might realise.
Artists and designers have been exploring and using colours for centuries and a lot of thought can go into using the right colours – whether it is setting the mood for an illustration, drawing the eye, or maybe building up a brand association. Because our brains are hardwired to notice when things are a different colour, it can be a useful element in our data storytelling.
But picking the right colours isn’t always that straightforward, especially when it comes to presenting the impactful customer data insight we do at dunnhumby. Selecting aesthetically pleasing[1] colours, or simply making charts using our existing brand palette may not be the best choice if we want readers to find insights in our data, or to quickly understand a visual we’re presenting.
We humans are visual creatures, with a large proportion of our brain’s neurons dedicated to processing what our eyes see, and we are also great at remembering images with a good degree of accuracy. As part of the subconscious visual process, our brain very quickly scans for what are called pre-attentive attributes – things like contrast, position, size and differences in colour.
Seeing as we are so good at it, it makes a lot of sense to visually encode aspects of our data using these attributes, allowing our brains to quickly identify patterns and notice things that stand out.
Colour can be used to represent the magnitude of some data, as we might see in heatmaps or conditionally formatted data tables, but it is particularly well suited to distinguishing different groups or series of data – be they segments in a pie chart, time-series lines, or stacked bars.
Up until now I’ve just been using the term “colour” in a loose sense. I won’t go into the physics of light reflection here, but there are a few different ways, or models, we use to specify any given colour. A common one, which is especially handy for us in data viz terms, is HSL or Hue-Saturation-Lightness:
These dimensions can be used in some combination as attributes within a chart, such as in these examples:
In each of these column and line charts I’ve altered only one of the colour dimensions at a time, keeping the others identical. Some work better than others and we should use a combination to generate a good amount of contrast for our readers.
I mentioned it’s not straightforward to pick colours for visualisation and that’s because there are a few things we should consider.
Most importantly when it comes to visualising data, we need to ensure the colours are helping our reader to understand the chart. We use colours to distinguish different data series, and to draw the eye to insights we want our readers to focus on.
For people with full colour vision it can be hard to appreciate that some readers may have difficulty discerning certain colours or seeing small changes in contrast. Some degree of colour-vision deficiency, such as Deuteranopia (difficulty telling reds from greens), affects around 1 in 12 men. Accessible design is, thankfully, becoming more and more of a hot topic and something we need to consider.
While we could focus our colour palette on the most effective and safe colours to facilitate understanding, we also need to factor in that aesthetic beauty does impact how readers will engage with and trust what we show. And as we’re often presenting visuals as part of a wider branded piece, such as a report or dashboard, we don’t want colours to look out of place.
Finally, we need to consider any conventions and colour associations our readers might already have. A common one being red/green to indicate negative or positive values – tricky given accessibility challenges mentioned above! – but we’ve also built up a colour language at dunnhumby where certain KPI metrics are always associated with a particular colour. There was quite the backlash when we absent-mindedly swapped some of those KPI colours during one product design update, which we hurriedly rolled back.
As you’ve seen in the image above, our harmonious brand palette is not always ideal for the purposes of making charts with more than a couple of colours. To get around this problem we’ve adopted a secondary colour palette, solely for use in data visualisation.
It’s not an uncommon practice, Google’s Material Design system recommends adding additional colours to represent data, and UK Retailer Tesco have defined an entirely separate colour palette for this purpose.
You can probably get away with using your primary brand colours for no more than three distinct series in a chart, but as soon as you’re going larger than that – eg multiple lines on a time series, or segments of a stacked bar chart – you’re best off utilising an entirely separate set of colours to help those data insights leap off the screen.
Hopefully I’ve shown that something seemingly as trivial as picking a few colours for your data viz can be more involved and there are quite a few things to consider.
As a closing note, my advice when it comes to picking colours for your charts and visuals? Use colours minimally and with purpose.
[1] ‘Pleasing’ is a subjective term. There are theories and guidelines about attractive or harmonious colour combinations, and how some colours might illicit emotional reactions – we don’t eat blue food, red/yellow might mean danger, etc – but at the end of the day maybe your reader just doesn’t like a particular colour. I distinctly remember a first bit of user feedback on one app prototype we were testing: “I don’t like that orange”.
Cookie | Description |
---|---|
cli_user_preference | The cookie is set by the GDPR Cookie Consent plugin and is used to store the yes/no selection the consent given for cookie usage. It does not store any personal data. |
cookielawinfo-checkbox-advertisement | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category . |
cookielawinfo-checkbox-analytics | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Analytics" category . |
cookielawinfo-checkbox-necessary | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
CookieLawInfoConsent | The cookie is set by the GDPR Cookie Consent plugin and is used to store the summary of the consent given for cookie usage. It does not store any personal data. |
viewed_cookie_policy | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
wsaffinity | Set by the dunnhumby website, that allows all subsequent traffic and requests from an initial client session to be passed to the same server in the pool. Session affinity is also referred to as session persistence, server affinity, server persistence, or server sticky. |
Cookie | Description |
---|---|
wordpress_test_cookie | WordPress cookie to read if cookies can be placed, and lasts for the session. |
wp_lang | This cookie is used to remember the language chosen by the user while browsing. |
Cookie | Description |
---|---|
CONSENT | YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data. |
fs_cid | This cookie is set by FullStory to store the user’s cookie consent preferences for session tracking. |
fs_lua | This cookie is set by FullStory to record the time of the user’s last activity, helping manage session timeouts. |
fs_uid | This cookie is set by FullStory to assign a unique ID to each user and record session replays and interactions. |
osano_consentmanager | This cookie is set by FullStory’s consent management system (Osano) to store the user’s cookie consent preferences and ensure compliance with privacy regulations. |
osano_consentmanager_uuid | This cookie is set by FullStory’s consent management system (Osano) to uniquely identify a user’s consent session for consistent consent tracking. |
vuid | Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos to the website. |
yt-remote-device-id | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
yt.innertube::nextId | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |
yt.innertube::requests | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |
_fs_tab_id | This temporary session value is used by FullStory to track user activity across multiple tabs. |
_ga | The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. |
_gat_gtag_UA_* | This cookie is set by Google Analytics to throttle request rates and limit data collection on high-traffic sites. |
_ga_* | Set by Google Analytics to persist session state. |
_gid | Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously. |
_lfa | This cookie is set by the provider Leadfeeder to identify the IP address of devices visiting the website, in order to retarget multiple users routing from the same IP address. |
__q_state_* | This cookie is set by FullStory to track session state and user interactions across page views. It helps rebuild session context for accurate session replay and analytics. |
Cookie | Description |
---|---|
aam_uuid | Set by LinkedIn, for ID sync for Adobe Audience Manager. |
AEC | Set by Google, ‘AEC’ cookies ensure that requests within a browsing session are made by the user, and not by other sites. These cookies prevent malicious sites from acting on behalf of a user without that user’s knowledge. |
AMCVS_14215E3D5995C57C0A495C55%40AdobeOrg | Set by LinkedIn, indicates the start of a session for Adobe Experience Cloud. |
AMCV_14215E3D5995C57C0A495C55%40AdobeOrg | Set by LinkedIn, Unique Identifier for Adobe Experience Cloud. |
AnalyticsSyncHistory | Set by LinkedIn, used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
bcookie | LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognise browser ID. |
bscookie | LinkedIn sets this cookie to store performed actions on the website. |
DV | Set by Google, used for the purpose of targeted advertising, to collect information about how visitors use our site. |
ELOQUA | This cookie is set by Eloqua Marketing Automation Tool. It contains a unique identifier to recognise returning visitors and track their visit data across multiple visits and multiple OpenText Websites. This data is logged in pseudonymised form, unless a visitor provides us with their personal data through creating a profile, such as when signing up for events or for downloading information that is not available to the public. |
gpv_pn | Set by LinkedIn, used to retain and fetch previous page visited in Adobe Analytics. |
lang | Session-based cookie, set by LinkedIn, used to set default locale/language. |
lidc | LinkedIn sets the lidc cookie to facilitate data center selection. |
lidc | Set by LinkedIn, used for routing from Share buttons and ad tags. |
li_gc | Set by LinkedIn to store consent of guests regarding the use of cookies for non-essential purposes. |
li_sugr | Set by LinkedIn, used to make a probabilistic match of a user's identity outside the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
lms_analytics | Set by LinkedIn to identify LinkedIn Members in the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland) for analytics. |
NID | Set by Google, registers a unique ID that identifies a returning user’s device. The ID is used for targeted ads. |
OGP / OGPC | Set by Google, cookie enables the functionality of Google Maps. |
OTZ | Set by Google, used to support Google’s advertising services. This cookie is used by Google Analytics to provide an analysis of website visitors in aggregate. |
s_cc | Set by LinkedIn, used to determine if cookies are enabled for Adobe Analytics. |
s_ips | Set by LinkedIn, tracks percent of page viewed. |
s_plt | Set by LinkedIn, this cookie tracks the time that the previous page took to load. |
s_pltp | Set by LinkedIn, this cookie provides page name value (URL) for use by Adobe Analytics. |
s_ppv | Set by LinkedIn, used by Adobe Analytics to retain and fetch what percentage of a page was viewed. |
s_sq | Set by LinkedIn, used to store information about the previous link that was clicked on by the user by Adobe Analytics. |
s_tp | Set by LinkedIn, this cookie measures a visitor’s scroll activity to see how much of a page they view before moving on to another page. |
s_tslv | Set by LinkedIn, used to retain and fetch time since last visit in Adobe Analytics. |
test_cookie | Set by doubleclick.net (part of Google), the purpose of the cookie is to determine if the users' browser supports cookies. |
U | Set by LinkedIn, Browser Identifier for users outside the Designated Countries (which LinkedIn determines as European Union (EU), European Economic Area (EEA), and Switzerland). |
UserMatchHistory | LinkedIn sets this cookie for LinkedIn Ads ID syncing. |
UserMatchHistory | This cookie is used by LinkedIn Ads to help dunnhumby measure advertising performance. More information can be found in their cookie policy. |
VISITOR_INFO1_LIVE | A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface. |
YSC | YSC cookie is set by YouTube and is used to track the views of embedded videos on YouTube pages. |
yt-remote-connected-devices | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
_gcl_au | Set by Google Tag Manager to store and track conversion events. It is typically associated with Google Ads, but may be set even if no active ad campaigns are running, especially when GTM is configured with default settings. The cookie helps measure the effectiveness of ad clicks in relation to site actions. |