Chart picker
Goal
Pick the chart that makes the answer to one question easy to see, and specify it well enough that it can be built without further decisions. A good result names the question, the chart, the encodings and the title that states the finding, and warns against the usual traps.
When to use
- The user has data and an unclear idea of how to display it.
- An existing chart is cluttered, misleading or confusing.
- A report or dashboard needs a consistent chart choice for a set of metrics.
- For laying out a dashboard sheet in a workbook, use
use_skillwithdashboard-sheet. - For writing up the findings around a chart, use
use_skillwithfindings-writeup.
Steps
- Write the question the chart answers as a sentence. If there are two questions, there are two charts. Use
ask_userto settle it, along with the audience and the medium (screen, slide, print). - Describe the data: how many variables, which are categories, numbers or time, how many categories, how many points. Use
run_commandto count categories and range if a file is given. - Map the question type to a chart family:
- Compare values across categories: horizontal bars sorted by value; vertical bars for few categories or time as categories.
- Change over time: a line for continuous series, bars for discrete periods.
- Part of a whole: a stacked bar or a single 100 percent bar; a pie only for two or three slices.
- Relationship of two numbers: a scatter plot, with a trend line only if it helps.
- Distribution: histogram, box plot, or dot plot per group.
- Ranking and change between two points: a slope chart or a dumbbell chart.
- Check the fit. More than about seven categories in a stack or a line set turns to spaghetti: highlight one series and grey the rest, or split into small multiples with shared axes.
- Set the axes. Bars start at zero. Lines may not, but then say so. Use the same scale on small multiples. Log scales need a note for general readers.
- Order and label: sort bars by value unless the categories have a natural order, put labels on the data instead of a distant legend, and keep text horizontal where it can be.
- Colour with purpose: one colour for the data and one accent for the point, a sequential scale for ordered values, and no rainbow. Check that the chart works in grayscale and for colour-blind readers.
- Write the title as the finding, such as "Returns doubled after the March change", and the subtitle as the measure, unit and period. Add the source line.
- If asked to produce it, build with
run_commandand save the image withcreate_file, then look at it again for overlaps and clipped labels.
Gotchas
- A pie chart with many slices cannot be read, as people compare angles poorly. Use bars.
- A bar chart with a truncated axis exaggerates differences. If the baseline cannot be zero, use dots or a line.
- Dual-axis charts make two unrelated series look correlated, because the scales are chosen freely. Prefer two stacked panels.
- 3D effects and shadows distort length and area. They add nothing.
- A chart with ten colours and a legend forces the reader to look back and forth. Label directly or cut series.
Output
- The question, the chart type and a one-line reason.
- The spec: axes, order, labels, colours, title and subtitle text.
- Two things to avoid for this data, and the alternative if the first choice does not fit.
