Chart Type Selection: A Decision Tree for Web

Chart Type Selection: A Decision Tree for Web

A decision tree for picking chart types by question type — comparison, trend, distribution, relationship, composition — with the chart misuses to retire from product UI.

Pick the chart type from the question you are answering, not the shape of the data you happen to have. Comparison wants bars. Trend wants lines. Distribution wants histograms. Relationship wants scatter. Composition wants stacked bars or treemaps, rarely pie. Five families cover much of product UI work, and some of the remaining problems are library defaults that should be replaced.

In product UI, the chart problem to check before the choice of library or the polish of the styling is whether the chart picked answers a different question than the user asked. A trend chart pretending to be a comparison, a pie chart pretending to be a ranking, a 3D bar pretending to add information — these all start with the wrong question.

The decision tree below is small on purpose. Five question types map to five chart families. Beyond that, refinements are tactical rather than structural, and reference works such as those by Stephen Few and Tamara Munzner, along with the graphical perception research of Cleveland and McGill (1984), cover them more deeply than any single article can.

Start with the question, not the data

Before opening the chart library, write down which of five questions the chart needs to answer.

Question typeWhat it asksDefault chart
ComparisonHow does A compare to B?Bar
TrendHow is X changing over time?Line
DistributionHow is X spread across values?Histogram
RelationshipDoes X correlate with Y?Scatter
CompositionWhat makes up the whole?Stacked bar or treemap

If the question fits two types — comparison and trend, for example — the analyst is asking two questions and probably needs two charts. Combining them in a single chart tends to degrade both. Small multiples — the same chart repeated across categories — can handle "but I want to see both" requests better than dual-encoding does.

If the question does not fit any of the five, it is usually not a charting question. Tables answer "what is the exact value" better than any visualization. Narrative answers "why" better than annotations. Dashboards answer "is something off" better than a single chart can. The Data Visualisation Catalogue is a useful reference for the long tail of specialized chart types, but the five above remain the starting point for product UI.

Comparison — bar charts dominate

Bar charts win the comparison family because each bar ends at a position along a common scale. In the ordering of elementary perceptual tasks that Cleveland and McGill hypothesized in 1984, position along a common scale ranks above angle and area, and in their position-angle experiment, which compared bar charts with pie charts, angle judgments had considerably larger average errors than position judgments. Stephen Few makes a similar point in his 2007 critique of pie charts.

Vertical bars work when categories are short and ordered by time or rank. Horizontal bars work when category labels are long or numerous — the labels then sit on their natural reading axis rather than tilted at 45 degrees. Sort bars by value unless the category order is meaningful (months, weekdays, alphabet). Sorting by value turns a comparison chart into a ranking chart, which is usually what the user actually wanted.

As the number of series per group or stack grows, grouped or stacked comparisons get hard to read. The fix is usually small multiples — one bar chart per category, arranged in a grid — rather than a denser single chart.

The y-axis on a bar chart starts at zero. Always. A truncated y-axis on bars turns a small difference into a large one and misleads the reader. The same rule does not apply to line charts (see below) because lines encode change, not absolute magnitude.

3D bars and perspective tricks add no information and distort comparison; gradient fills add no information either. They should not appear in a 2026 product UI.

Trend — line charts, but with care

Line charts work when the x-axis is continuous — time, sequence, or ordered numeric values — and the question is how the y-value changes across that continuum.

Keep a single line chart to a few lines; a common rule of thumb, not a measured threshold, is no more than about five. Past that point, the chart becomes a tangle that is hard for any reader to follow. Two patterns handle the "but I need more lines" case: small multiples (one line chart per series, all sharing axes) and the highlight-and-mute pattern (one series in saturated color, the others as low-opacity gray context). Both preserve readability where a spaghetti chart of overlapping lines fails.

The y-axis on a line chart may not start at zero when magnitudes are similar enough that a zero-anchored axis makes all change invisible. Stock prices, percentages, and bounded ranges are the common cases. Disclose the choice explicitly — show the axis bounds, do not pretend they were obvious. The asymmetry with bar charts is intentional: bars encode absolute size, so a truncated axis lies about size; lines encode change, so a zoomed axis honestly emphasizes change.

Annotate inflection points and known events. A launch date, an outage, a pricing change, a policy reversal — the reader needs to know why the line bent. Annotations are the difference between a chart that reports data and a chart that explains it.

Distribution — histograms and box plots

The distribution family answers "how is this one variable spread across its possible values," which product UI often asks silently while showing a mean and calling it done.

Histograms are the workhorse. Bin width matters more than many defaults suggest — too few bins hide structure, too many turn the chart into noise. The Freedman-Diaconis rule (robust to outliers, though it can be too conservative for small datasets) and Sturges' rule (only optimal for normally distributed data; it underestimates the number of bins for large non-normal datasets) give sensible starting bin counts; the more honest answer is to try a few and read the chart, because the right bin count depends on which feature of the distribution matters.

Box plots compare distributions across categories — five-number summary (minimum, first quartile, median, third quartile, maximum) per category, side by side. They are denser than a histogram and assume the reader already knows how to read them, which many product users may not. In analyst-facing tooling, box plots are fine. In customer-facing product UI, histograms are usually the safer choice.

Violin plots show the shape of the distribution where a box plot only shows quartiles. Use them when the difference between bimodal and unimodal matters to the question. Many product UI surfaces do not need them.

A simple rule: if the audience is engineers or analysts, distribution charts can lean technical. If the audience is general users, histograms are usually the safest distribution chart to show.

Relationship — scatter and bubble

Scatter plots answer "do these two variables move together," which covers much of the relationship family in product UI.

A scatter plot needs enough points that the eye can read a pattern. With only a handful of points, a small table reads better. With very high point counts, overplotting destroys readability and the fix is either hex binning (color or shade encoding density inside hexagonal bins) or a 2D density plot.

A trendline plus the correlation coefficient sits well on a scatter plot when the question is "how strong is the relationship." Without the trendline, the reader has to estimate by eye. Without the r-value, they cannot quantify what they estimated.

Bubble charts add a third dimension via point size. As a rule of thumb, not a measured threshold, they work for three or four named points (countries, products, segments) where the reader will read each one individually. Beyond that, size becomes one more encoding to decode and the chart fails.

Composition — stacked or treemap, rarely pie

Composition charts answer "what makes up the whole," and they are a family that is easy to misuse.

Pie charts work for two or three slices with a clear majority. As slices multiply, ranking and comparing them gets harder, and stacked bars or treemaps win. The three-slice ceiling is a rule of thumb, not a measured threshold; the perception finding behind it is that angle and area are judged less accurately than position along a common scale. Stephen Few's Save the Pies for Dessert (2007) sets out the case for why most pies should be retired: slice sizes are easy to judge only near 0, 25, 50, 75, or 100 percent of the circle.

Stacked bars show composition across categories — total height per category, segments inside. They handle "is the composition the same across regions" better than a row of pies. The order of segments matters; keep it stable across categories so the reader's eye can track the same segment.

Treemaps show hierarchy plus relative size. They are dense and assume the reader will spend time reading them. They suit analytics interfaces with patient users and fail in glanceable product UI.

Sankey diagrams show flow between categories — useful when the question is "how does this convert from stage to stage" or "where does this attribute go." Like treemaps, they are reading charts, not glancing charts.

Common chart misuses to retire

A small list of chart choices that should have left product UI by 2026:

  • 3D anything. 3D bars and pies distort comparison because foreground slices look larger than background slices of the same size. No 2D chart loses information by removing the third axis.
  • Pie charts with ten or more slices. The smallest slices are unreadable; the rank order is uncomputable. A stacked bar or treemap is the better choice.
  • Dual y-axis without an explicit correspondence. If two series do not share units, plotting them against two separate y-axes over the same x-axis makes the reader infer a relationship from where the lines cross or diverge, even though each axis scale is an arbitrary choice. Small multiples or two separate charts are the honest alternatives.
  • Truncated y-axis on bar charts. A bar implies "this much"; truncating the axis lies about how much. Lines are different (see Trend); bars are not.
  • Color as the sole encoding for ordinal data. WCAG 1.4.1 Use of Color (Level A) requires that color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. A 2018 study from the UW Interactive Data Lab, run with participants screened for normal color vision, found measurable error when values are judged from color alone, with the rainbow-style jet colormap the most error-prone. Pair color with shape, label, or pattern.

Companion pieces on this topic cover the rest of the chart surface: dashboard and KPI card patterns walks the multi-chart context that decides which chart families need to coexist, and data visualization color and accessibility covers the palette and screen-reader work that decides whether the chart reaches its audience. Both sit underneath the main guide on web UX design patterns.

Pick the question first, the chart family second, and the library third. For the right chart family, the library default can ship acceptably; when a chart still fails, check whether the wrong chart family was picked before blaming the library.

Project Inquiry