A chart’s legend is usually generated from the data. However many categories the data has, that’s how many rows the legend gets.

Most of the time that’s fine. When the legend is there to explain, it’s the wrong approach.

The report said “the icons aren’t aligned”

We measured three times. The alignment was fine.

What had actually happened was that two categories in that batch of data were empty, so the legend lost two rows. The user remembered a legend with seven rows and now saw five. Something felt wrong, and the closest way to put it was “not aligned.”

What people say and what caused it

What users describe is the discrepancy they noticed, which isn’t necessarily what caused it. There are often several layers in between.

So when a report about something on screen comes in, we don’t start by fixing what it literally says. We measure first, then decide which problem they’re actually describing.

The rule

Components that explain list every item.

Legends, color keys, status tables, icon indexes: these are there to help people form an impression once. Their job isn’t to reflect what’s in this batch of data. Empty categories get listed too, just marked as having no data.

Components that present follow the data. Bars, lines and cards should only draw what exists.

The same chart will have both. To tell them apart, ask whether the thing is there to explain or to present.