A chart can look clear on your own monitor and still make readers work too hard. If the instructions say “compare the blue and orange bars”, the reader has to match colours before they can understand the numbers.
For a small comparison, put the category and value beside each bar. Here is a deliberately simple HTML/CSS example using fictional completed-task counts: 42 for Project A and 68 for Project B.
Keep the information in text
<section aria-labelledby="comparison-title">
<h2 id="comparison-title">Completed tasks — fictional example</h2>
<p>Both bars use the same scale: 0 to 100 tasks.</p>
<ul class="comparison">
<li>
<p><strong>Project A:</strong> 42 tasks</p>
<div class="track" aria-hidden="true">
<div class="bar" style="width: 42%"></div>
</div>
</li>
<li>
<p><strong>Project B:</strong> 68 tasks</p>
<div class="track" aria-hidden="true">
<div class="bar" style="width: 68%"></div>
</div>
</li>
</ul>
</section>
.comparison { max-width: 36rem; padding: 0; list-style: none; }
.comparison li { margin-block: 1.5rem; }
.comparison p { margin-block: 0 0.5rem; }
.track { background: #ededed; border: 1px solid #333; }
.bar { height: 1.25rem; background: #222; }
The bars are decorative duplicates of the adjacent text, so the wrapper uses aria-hidden="true". The actual category names, values and units remain ordinary HTML text. Do not hide the text labels along with the bars.
Explain the scale
Both tracks have the same width and represent 100 tasks. A 42% bar therefore represents 42 tasks in this particular example. If the maximum changes, calculate each width from value / maximum × 100 and update the stated scale too. A percentage width without a clear shared scale can mislead readers.
Check what survives
- Read only the text. Can you identify both categories, their values and the unit?
- View the page in greyscale. Can you still identify each bar without a colour legend?
- Narrow the browser window and zoom in. Check for clipped labels and horizontal overflow.
- Change one value. Confirm the label and bar length still agree.
These checks cover a small example; they are not a complete accessibility audit. More complex charts need additional work, including meaningful summaries and suitable access to their underlying data.
The principle of providing a visible cue in addition to colour is explained in W3C's Understanding Use of Color.
Try it: replace Project A and Project B with two fictional categories of your own. Ask someone to explain the comparison without referring to either bar's colour.
More practical creator guides: EchoFollowers.
Top comments (0)