Dataviz Selector
Use this before making a chart when the user has a dataset and a question/hypothesis/story to answer.
Core job: pick the visual form that makes the intended claim easiest to see and hardest to misread.
For non-trivial chart selection, use the workflow and guardrails below; private local references may add nuance, but this public skill is self-contained.
Workflow
-
Disambiguate semantics before choosing a chart: identify the measure, denominator, displayed universe, relevant time/context boundaries, claim strength, and audience meaning of the units. Choose a form and semantic cues that make the intended comparison hard to misread; do not prescribe a chart type, vocabulary, or annotation when another defensible design communicates the distinction equally well.
-
State the one-sentence claim the chart must support. If there are multiple claims, split into multiple charts.
-
Identify the comparison: time, peers, baseline, target, counterfactual, distribution, spatial context, model expectation, or decomposition.
-
Identify the data grain: time series, category, entity, location, event/ball, survey response, model output, simulation, transaction, or scorecard metric.
-
Inspect the data's structure for features relevant to the stated claim. Treat apparent breaks, extremes, clusters, or changes as candidates only when they are robust enough, materially informative, and useful at the intended viewing scale; detailed candidate selection belongs to
chart-annotations. -
Choose the simplest chart that exposes that comparison.
- Add only necessary context: direct labels, event line/band, threshold, uncertainty ribbon, counterfactual, facet, or annotation. Detailed annotation selection belongs to
chart-annotations.
- Say what to avoid: misleading axis, overplotting, unnecessary regression, crowded legend, map-for-ranking, stacked bars for precise comparisons, etc.
- If generating code, then also apply
karthik-data-visualizationstyling before final output.
Fast chooser
- Trend/intervention: choose a form that exposes level, change, comparison, and uncertainty; add a supported event or baseline context when it changes interpretation.
- Nonlinear or changing trajectories: show the observations and use a derived summary only when its assumptions and uncertainty remain visible.
- Slowing growth: show the level and the comparison that establishes slowing; use a derivative or projection only when it answers the stated question and is interpretable to the audience.
- Forecast/anomaly: actual line, forecast/dashed line, uncertainty ribbon, highlighted anomaly/intervention window.
- Many comparable series: small multiples or cluster prototypes; avoid spaghetti.
- If the chart will be consumed in chat or at thumbnail size, prefer forms that support direct labels and strong contrast; avoid designs that depend on faint colour differences or tiny legends.
- Choose colour by data role: when the story is one item among several, it's a trade-off between crowding and too many panels. While the lines stay easy to follow and label in one panel (usually up to about five), keep them together with the focal one coloured and the rest muted; once they start to tangle, switch to small multiples with the focal item's panel first; qualitative hues for nominal identity, a perceptually ordered sequential scale for magnitude, and a diverging scale only around a meaningful midpoint. If colour is doing work that position or direct labels could do better, remove it.
- For slopegraphs, place endpoint labels where they remain paired and legible, then choose the aspect ratio from row density, label geometry, and delivery medium rather than a fixed orientation.
- For two-point comparisons, choose among slopegraphs, dumbbells, paired bars, dot plots, or tables according to whether the main task is seeing change, comparing endpoint values, or reading exact values. The number of time points alone does not determine the form.
- Ranking: sorted horizontal bars; bar axis starts at 0; highlight an item only when the question, evidence, or stated story makes it focal. Otherwise keep equal-status items in one colour, which need not be grey.
- Ordered category axes (time, stages, sizes, ranked bins) keep their sequence and reading direction. Sort by magnitude only when the categories are nominal.
- A signed change, net, or difference is not a part of a whole. Never show it as a share, stack, or pie; use diverging bars, a waterfall, or a slope.
- Composition/share substitution: parts summing to 100% is a property of the numbers, not a reason to stack. For shares changing over time, default to one line per part, labelled at its end. Use 100% stacked bars or areas only when broad mix at one or a few points is the story. Only segments that begin or end on an aligned baseline support precise visual comparison; a fixed-total stack aligns both outer edges, while internal segments still float. If the claim depends on component patterns across periods or groups, use small multiples, grouped bars, dot plots, lines, or a compact table instead.
- Distribution/skew/tails: histogram, density, ECDF, box, or violin; log scale for income/wealth/power-law data.
- Log axes suit position encodings (points, lines, box plots) whose positive values span orders of magnitude, never bars or areas, which encode by length. Mark the axis as log and keep tick labels in original units.
- Relationship: scatter with direct labels; regression only when relationship is the claim and uncertainty is shown.
- Normalization: preserve the relationship between numerator and denominator, then choose a form based on whether the task is ranking, scale diagnosis, temporal/spatial variation, or distribution.
- Domain-specific questions: derive the form from the mechanism, comparison, uncertainty, and audience rather than applying a domain recipe.
Output format for recommendations
Use this concise structure:
markdownRecommended visual: <chart form> Why: <claim-comparison fit> Encoding: X = ..., Y = ..., colour/facet/label = ... Context layers: <thresholds/events/counterfactuals/knee-bends/local extrema/annotations> Avoid: <bad alternatives or pitfalls> If implementing: <short code/design note>
Hard guardrails
- One chart, one main job.
- An explicit form request in the prompt overrides these defaults.
- No redundant panels: a second view earns its place only by carrying a message the first cannot. Treat commonly problematic forms as risk conditions, not universal prohibitions. Recommend the simplest form that preserves the intended comparison in the actual medium. A form that is often misleading may still be appropriate when its purpose, encoding, audience, and limitations are explicit; reject it when it obscures magnitude, comparison, uncertainty, or interpretation.
- Bars start at zero; scatters need not. When the variation is small against a large common level, switch to a position form (dots, dumbbell, connected points) on a zoomed scale instead of truncating the bars.
- Do not extend regression/counterfactual lines beyond defensible range without marking them as projections.
- Label derived meaning directly when the evidence is a gap, quadrant, cluster, area between curves, knee-bend/inflection, or local maximum/minimum.
- Prefer direct labels to legends.
- Choose a form in which labels and marks pair without guesswork at delivery size. If the natural baseline pushes labels far from the marks they identify, use a compact row structure, restrained guides, a table-chart hybrid, faceting, or another form that restores immediate traceability.
- Size the canvas from the information and delivery medium. Whitespace should group, separate, or emphasize; do not retain blank regions merely because the plotting library or source aspect ratio created them.
- If part-to-whole is requested, prefer sorted bars, 100% stacked bars, tables, or small multiples when every part gets a legible row and the reader compares the parts. A pie, donut, or treemap fits two cases: two or three parts, or many parts where a long tail of small ones doesn't matter. An area form keeps the same footprint however many parts there are, so the tail shrinks to slivers while the big parts stay readable; bars give every minor part a row and leave most of the canvas empty or crush the text. Either way, write the name and share on or beside each part that matters; no legend. Use stacking only when the reader needs broad composition, not precise component pattern comparison. Direct labels can support lookup of exact values; if comparison remains difficult or labels become crowded, change the form.
- Use maps only for spatial stories.
- If a clever chart needs too much explanation, use a simple chart plus annotation.
- Add a label or annotation only when it materially improves the intended reading; detailed candidate selection and wording belong to
chart-annotations. - Choose between a chart, table, dashboard, or interactive view according to whether the task is monitoring, exploration, comparison, or narrative explanation.
- Put the most important comparison on the most accurate channel: position on a common scale, then length, then angle or slope, then area, then colour. When the main quantity sits on a weak channel, move it to a stronger one.
- Do not put two series on independent y-axes to imply they move together. Index them to a common base, stack two panels on a shared x-axis, or use a scatter if the relationship is the claim.
- In small multiples, share the value scale whenever the reader compares across panels. Use free scales only when each panel's own shape is the message, and say so on the chart.
- A well-formatted table is a legitimate answer when the task is exact lookup or the measures share no honest common scale. Then apply
karthik-table-styleinstead of chart styling. - Do not merge, bucket, or split categories to manufacture a claim. A grouping needs a reason in the data or the question, not because the coarser cut looks cleaner.


