Skip to content

Horizontal Bar Chart #176

Description

@asier-hmrc

Name of component or pattern

Horizontal bar chart

Name of your service

Annual Tax Summary (ATS) -- within Personal Tax Account

Overview

The pattern helps sighted users understand quantitative data by adding a complementary visualisation layer of information.

View screenshot to proposed pattern

Code snippet

HTML
	
      <div class="govuk-summary-list__row content">
        <dt id="Health" class="govuk-summary-list__key">Health
          <span>&nbsp;(21.9%)</span>
        </dt>
        <dd class="govuk-summary-list__value">£1,241</dd>
      </div>
      <div aria-hidden="true">
        <dt class="graph-green-bar" style="width:21.9%;"></dt>
        <dd class="graph-grey-bar"></dd>
      </div>

CSS
	.graph-green-bar {
	border-bottom: 10px solid #28a197;
	}

	.graph-grey-bar {
	border-top: 2px solid #b1b4b6;
	}

Is it useful and unique?

Usefulness

This pattern aims to integrate a bar chart into existing GOV.UK Table/DL-type layout.

Numerical data in tabular format provides detail and accuracy to information, but it can be cognitively demanding specially to non-expert users. Numerical information alone involves a degree of mental mathematical calculation to be able to interpret and evaluate.

The bar chart helps users evaluate and compare quantities intuitively. It adds an additional dimension to numerical data that helps grasp the whole and get to the gist of the information.

The proposed pattern offers two complementary modes of reading in a single layout -- table and graph. One mode supplements the other without interfering with each other. The user is able to access both separately or in combination, depending on their needs and cognitive preference.

Examples of possible useful applications:

  • percentages, amount vs 100
  • progress status vs completion
  • Due tax vs income
  • Part payments made vs remaining debit
  • Comparing multiple related amounts, eg. difference of recurring amounts across tax years

Uniqueness

It is unique in GDS as there is no exiting component that graphically communicates quantitative data.

Assistive technology

The bars assist sighted users only. The bars are 'visually-hidden' and not described by screen-readers. The data is universally accessible via the content.

Other components or patterns you've tried

There are no existing pattern/components. The previous existing live implementation of these bar charts were too cumbersome and distracting for reading the data -- especially in small screen devices.

View screenshot of mobile views of previous implementation versus proposed pattern.

Reuse of existing GDS component

  • This current implementation in ATS uses a Description List HTML element to structure the table but it can also be achieved using a Table element.
  • The addition of the bars increases the line-height to accommodate the bars. It does not change the table's screen responsiveness in any way.
  • The proposed pattern makes use of the existing (table and DL) horizontal dividing line but gives it a new additional role. It indicates the full measure (100%) against which the bar length is compared. Bar and grey line relate to each other. The line is 2px thick for a stronger presence next to the bar.
  • Bar colour used in the ATS implementation is govuk-colour("turquoise") but any other GOVUK colour could be used keeping within WCAG colour contrast guidelines.

Research on this pattern

UR sessions on ATS service with 6 participants. October 2022

  • 1 of 6 commented positively on the bar chart, unprompted. The other 5 said nothing about the bars, instead commenting on the information itself. This suggests the bars were not perceived as strange or intrusive, instead taken for granted as being part of the information.
  • When prompted to comment on them, these five users explained the bars as a matter of fact. All commented positively on the table with bar charts.
  • When prompted, all six correctly interpreted the meaning of the bars to be directly representing the percentages above them.

External literature research on bar charts comprehension

Review of Graph Comprehension Research: Implications for Instruction. Shah and Hoeffner, 2002. Educational Psychology Review, Vol. 14, No. 1, March 2002. PDF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions