Honest Story Charts
Create charts that lead with their takeaway and stay honest, ensuring the reader understands the message in about three seconds. The chart should be readable in greyscale and tell a complete story when only titles are viewed.
Editor's Note
Before creating the chart, write a clear 'so what' sentence: '[Subject] [did what] [by how much] [compared to what / why]'. This sentence becomes the title. The subtitle holds the metric, units, and time range. If you can't write the sentence, you're in 'explore' mode, which shows all data evenly with error bars and precise axes.
When to Use It
- Explain findings to executives or clients in slide decks or social posts
- Create dashboards that highlight key insights with clear takeaways
- Design charts for reports or emails that explain themselves without narration
- Build reference dashboards for analysts or scientists that show all data evenly
SKILL.md
SkillsHunter provides this listing for informational purposes only. Review the skill’s source, license, and required permissions before use. You are responsible for deciding whether to install or run it. Terms of Use
Honest story charts
Default AI charts dump the data: every series in a rainbow palette, a legend, a generic title, gridlines everywhere and no conclusion. This skill makes every chart lead with its takeaway, so the reader gets the message in about 3 seconds, and keeps it honest, so the message survives scrutiny.
Every chart can be built two ways:
| Default chart (avoid) | Story chart (this skill) |
|---|---|
| All series equally loud | One thing in color, everything else grey |
| Title names the metric ("Revenue by month") | Title states the finding ("Revenue fell 37% short of plan") |
| Legend box | Labels sit right next to the lines and bars |
| Bare number ("$4.2M") | Number with something to compare it to ("$4.2M ▼15% vs last month, target $5.4M") |
| The reader has to work out the story | Annotation, band, bracket or reference line carries the story |
Use this skill with any charting stack (matplotlib, Plotly, D3, Chart.js, Excel, slides, HTML dashboards). If a palette/dataviz skill or a brand design system is loaded too, take colors and fonts from it and the storytelling and honesty rules from here. See Using it in any tool or stack at the end.
Step 0: Decide the job, explain or explore
Ask yourself (or the user, if unclear) who the chart is for:
- Explain (execs, clients, slide decks, social posts, "so what should we do?"): pick ONE story, highlight it, and put the conclusion in the title. This is the default.
- Explore (analysts, scientists, reference dashboards, appendices): show all the data evenly, with error bars and precise axes, and let readers find their own insights. Neutral title.
One chart can't do both well. The audience decides the dressing:
- Scientist/academic: error bars, full axes, neutral title, methods note.
- Consultant/exec: sorted bars, the top items in color and the rest grey, a takeaway headline, values printed on the bars.
- Never pick a chart because it looks fancy (radar, 3D, pie).
- Ask how it will be delivered, because the medium changes the dressing: a live talk gets a sparse chart (you narrate); a read-alone report or email needs more annotation and must explain itself; a dashboard has no presenter, so overview first and detail on demand; a social post carries one idea in big text.
- Ask what the reader should do after seeing it. In explain mode, the subtitle or a closing annotation states the recommended action when there is one.
Step 1: Write the "so what" sentence first
Before choosing a chart, write one sentence: "[Subject] [did what] [by how much] [compared to what / why]."
- Good: "Store E drove 31% of annual sales, peaking in July."
- Bad: "Sales by store and month."
That sentence becomes the title. The subtitle holds the metric, units and time range. If you can't write the sentence, you're in explore mode (Step 0).
Three quick tests once it's built:
- Glance test: where do your eyes land first? That must be the point.
- Greyscale test: does the message survive without color?
- Titles-only test (decks and dashboards): read only the titles in order. They should tell the whole story, and each chart should still make sense on its own.
Step 2: Find the story type, then apply its move
Match the "so what" to a row below and apply that technique. This catalog is the core of the skill.
Lines over time
| Story | Move |
|---|---|
| Difference between two series | Shade the area between the lines, using each series' color for the stretch where it leads. |
| Shortfall / gap vs plan | Plan as a dashed line, shade the gap, and label the end with something like "Shortfall −37%" in the accent color. |
| Forecast | Solid actuals, dashed forecast. Add a vertical "Today" divider and a light grey box behind the forecast region, labeled "Actual" and "Forecast". |
| Confidence | A fan or band around the forecast (darker inner band, lighter outer band), or error bars on points. |
| Recovery / drawdowns | Shade each dip and label how long it took to recover ("20 days", "14 days"). |
| Seasonality | Overlay the years on one Jan–Dec axis. Current year in color, prior years in grey, each labeled at its line end. |
| Reason for a dip or spike | A shaded vertical band over the period, labeled with the cause ("Data outage", "Holiday sales"). |
| Event / turning point | A dashed vertical line labeled "Event X". Color the line after the event in the accent color. |
| Several events | Dots at each event with short labels ("Event A/B/C") and no legend. |
| Signal in noise / one of many lines | Every line grey and thin, the one that matters thick and in color, labeled directly. |
| Spaghetti (4+ crossing lines) | Small multiples, one panel per series, same axes. |
| Leaders over time | Shaded bands showing which series led in which period, plus the crossover dates. |
| Movers between two points | A slope chart (start to end) with labels and values on both ends. Color risers vs fallers. |
| Missing data | Never connect straight through a gap silently. Use a dashed connector, grey out the missing x-labels and annotate "missing data 2021–22". |
| Live / partial data | Mark the incomplete current period (hatched or lighter, "partial month"). |
| Many similar series | Group the small multiples by pattern into labeled panels: Rising / Falling / Steady. |
Bars and categories
| Story | Move |
|---|---|
| Vs target | Bars in grey at their true height, target as a dashed line. The part above the target is solid green. A shortfall is drawn as a light, hatched or outlined red "missing" segment from the bar top up to the target, so the bar still reads at its real value. Put "+7" / "−12" labels at the target line. |
| Over budget / excess | Grey bars, and only the part above the budget line in red, with its value. |
| Concentration / top items | Color the top N, grey the rest, add a bracket or brace with "28% of total". |
| Long tail | Show the top N and collapse the rest into a grey "Others" bar. |
| Ranking | Sort descending, horizontal bars, values at the bar ends, no x-axis. |
| Span between two values per item | A dumbbell or range bar instead of grouped bars. Label both ends. |
| Evaluation / score vs max | Bars over a full-length grey track to 100%, colored by tier (green/amber/red). |
| Performance vs target per item | A bullet chart: grey ranges, a dark bar for the actual, a tick for the target. |
| Proportions AND sizes | Stacked 100% bars with column width proportional to the total (Marimekko), or totals labeled above. |
| Groups | Color by group, not by bar. Leave a gap between groups. |
| One standout | Everything grey, the standout in the accent color with a direct label. |
| Part of a whole (%) | One stacked bar: accent for the share, grey for the remainder. Use a waffle (10×10) instead of a pie for one share. |
| Likert / agree–disagree | Diverging stacked bars anchored on a center line. Put neutral in its own column, not split across the center. |
| Mean hides the story | Show the distribution (strip, beeswarm, box plot or ECDF) instead of a bar of averages. Compare medians when the data is skewed. |
| Ratings on a small fixed scale (1–5, 1–10, NPS) | Don't jitter dots, because they stack into flat lines. Use diverging share bars (% below the pass mark on the left, % at or above it on the right), sorted worst first, with "avg 3.7" printed as context at the bar end. |
| How we got from A to B | A waterfall (bridge): start and end totals in grey, increases in green, decreases in red, each step labeled with its value. |
| One number | Not a chart. Use a stat tile (big number plus a comparison). Never a one-bar chart or a two-slice pie. |
| Stages with drop-off | A funnel: bars in stage order with the drop-off % between steps, the worst drop in the accent color. Use a Sankey only when flows split and merge. |
| Where (geography) | A map with one sequential hue and a labeled scale; label only the regions the story is about. Use a sorted bar chart instead when exact comparison matters more than location. |
Distributions, scatter, density
| Story | Move |
|---|---|
| Distribution shape | A density curve with a rug of the raw values as ticks underneath. |
| Many distributions | A ridgeline, colored per group, if overlap is moderate. Otherwise use box plots. |
| Threshold / pass mark | Dots per group, a dashed pass line, dots below it in red, and the "% below" printed under each group. |
| Scatter meaning | Split it into labeled quadrant regions, lightly tinted (e.g. Quick wins / Major projects / Fill-ins / Avoid). In explain mode, label only the points the story is about, in the accent color, and leave the rest as unlabeled grey dots. Labeling every point causes collisions. |
| Overplotted scatter | A hexbin or 2D density instead of thousands of dots. |
| Trend in noisy scatter | A LOESS smooth over light points. Don't zigzag-connect the dots. Skip it for small or seasonal data. |
| Wide value range | Log scale, and say "log scale" on the axis. |
Heatmaps, tables, KPI tiles, dashboards
| Story | Move |
|---|---|
| Heatmap | Add marginal total bars (a row on top, a column on the right). Call out the top cell, row and column in dark with a label ("best month", "top store"). |
| Table | Keep the table, but highlight the key cells and add a sparkline "trend" column. |
| KPI number | Never a bare number. Add at least one comparison: vs past (sparkline + "▼15% vs last month"), vs target (bullet bar to target, with the gap labeled), vs peer (two bars), or vs a good range (Weak/Fair/Strong gauge with a marker). Color the delta: green good, red bad, judged by direction-of-good, not by sign. |
| Dashboard | (1) One view = one decision or topic, so cut everything else. (2) Hierarchy: one hero tile, larger and top-left, with supporting tiles smaller. (3) Group related tiles under section headers (Revenue / Audience / Performance) with light tinted panels. (4) Anchor every number with a benchmark, target or prior period. (5) Lay out in a Z-pattern: most important at the top-left, details at the bottom-right. (6) Mark live or incomplete data. (7) The tile the headline is about gets a light accent tint and border, plus a short status tag ("needs action") on the big-number row. Narrow tiles have no room for it on the label row. (8) For a cumulative KPI against a deadline, the target bar shows a pace marker (the share of the target that should be reached by today). (9) In explain-mode dashboards (one story, exec audience), show 3–6 KPI tiles and no more than about 5 visuals above the fold; detail goes to drill-down. Analyst (explore) dashboards can go deeper, but still through drill-down rather than more panels on the first screen. (10) When filters are applied, say so in the subtitle ("Day 2 only · South region"). (11) Show an "as of" timestamp and the data source in the footer. |
| Interactive (web) | Prefer always-visible direct labels over hover-only tooltips, since hover isn't accessible. Use hover, drill-down, a brush window or a variable target line only as extras. On web, still add a hover/tap tooltip with exact values by default; it's an extra, never the only place a key value lives. |
Step 3: Apply the house style
Color
- Base everything in neutral grey: context marks
#C9CDD3(#9AA1ABfor a second context level), text#3D4249, title#1F2328, muted text#6B6B6B. Use one accent (#C2410C, or the brand color once validated) for the point, and a second color (blue#2166AC) only when comparing two things. - Good/bad: green
#0F7B55/ red-orange#C2410C, amber#B7791Ffor the middle. Amber is for marks only: it fails 4.5:1 as text, so amber items get dark text labels. These colors pass colorblind separation and contrast on white and#FAF9F6. The context greys are the deliberate exception:#C9CDD3(1.6:1) and#9AA1AB(2.6:1) sit below 3:1 so they recede. Use them only for marks that aren't the story, and never let a grey mark be the only carrier of a value the reader needs (label it). Light tints for bands, regions and chips:#FBE9E2,#E3F2EC,#F8EEDC,#E4EDF7. - Swapping in a brand color? Check it before use with
contrast()(≥ 4.5 for text, ≥ 3 for marks), and check that it stays distinct from the other colors under colorblind simulation. - Same group = same hue family. Never a rainbow for categories that aren't the story.
- Match the color type to its job: categories get distinct hues in a fixed order; magnitude gets one hue, light to dark; above/below a midpoint gets two opposite hues (warm vs cool) with a neutral grey middle. Never a rainbow, and never a light-to-dark ramp on categories that have no order.
- Color follows the entity, not its rank. When a filter removes a series, the remaining series keep their colors.
- More than about 7 colored categories: fold the tail into "Other", split into small multiples, or use a table.
- Accessibility: never rely on color alone. Add patterns/hatching for shaded categories, direct labels and different markers. Check colorblind safety by computing it, not by eye: run the final colors through a colorblind simulation or palette checker.
Ink
- Background: the chart sits on a white card over a soft page (
#F6F7F9), or plain white / warm off-white (#FAF9F6). No 3D, no gradients, no shadows, no bar outlines (the hatched shortfall segment is the one exception). - Gridlines: hairline horizontal only (
#ECEDEF), drawn behind the marks, or none when values are labeled. No vertical gridlines on time series. - Axis line only on the baseline. Drop tick marks. Format numbers with K/M/B and minimal decimals (keep precision for finance, science and engineering).
- Labels next to the data instead of legends: put the series name at the end of each line. Give the label the series color only if that color passes 4.5:1 contrast against the background; otherwise use dark text next to a small colored marker. With 5+ series, or when a house design system requires a legend, keep a small legend and still direct-label the series the story is about.
- Sort bars by value unless the categories have a natural order (time, stages, a scale). Panels meant to be compared share one category order (sort by the total or by the first panel, never each panel separately) and one scale. On dashboards with filters, fix the axis maximum to the largest value across every filter state, totals included, so bars don't silently rescale when the filter changes.
- Separate adjacent bars and stacked segments with a thin gap in the background color, not a border.
- Minimum text size: 11–12px on screen, 14px+ on presentation slides.
- Horizontal text only. Never rotate labels 45°. Use horizontal bars, or wrap and abbreviate labels.
- Units go in the subtitle ("Daily app installs (count)", "Revenue, $M"), or in the top tick label ("1,000 installs"). Don't add a separate y-axis title above the plot, because it collides with the subtitle. Never rotate an axis title.
Text
- Title = the takeaway (bold, around 18–20px), under about 60 characters or wrapped onto two lines. It must never be clipped by the chart width. Subtitle = metric, units and period (grey, around 13px).
- Annotations go in the accent color, in plain short text, placed next to the mark they explain. Use a thin leader line if needed. Keep them inside the plot area, never in the title/subtitle band, including annotations on marginal or side panels.
- Brackets/braces label groups of bars or ranges right where the eye lands, instead of a legend.
- Footer: "Source: …" plus notes on missing data, log scale or estimates, small and grey. Always include a source.
Shapes
- Use dashed lines for forecast, plan, target, missing data and reference lines. Use solid lines for actuals.
- Highlight a time window with a shaded band and give it a label inside the band at the top.
Modern finish (never ship a library's default look) The story comes first, but style decides whether people trust and share the chart. Every chart gets this finish:
- Type: Inter, or the platform UI font (SF Pro, Roboto, Segoe UI). Title semibold 17–20px in
#1F2328; an optional small uppercase kicker above it in the accent color ("FUNNEL · Q3"); subtitle in#6B6B6B. - Frame: a white rounded card (radius about 12px, 1px
#E6E8EBborder) on a soft page#F6F7F9. No drop shadows. - Bars: round only the free end (4–6px); keep the baseline and stacked joins square. Draw each bar as one shape so no seam shows (
round_bars). Leave a thin gap between bars. - Lines: 2–2.5px with round caps. Put an end dot with a 2px white ring on the highlighted series (
end_dot). An optional soft fill (8–12% tint) under the hero line. - Callouts and deltas: tinted chips (
chip): text in the color, background its light tint. Delta badges like "▲ 12%" in good or bad color. - Axes: text
#6B6B6Bat 9.5–11px, no tick marks, hairline grid. - Web and apps: the same tokens as CSS variables. Rounded bar ends: ECharts
itemStyle.borderRadius: [6,6,0,0], Chart.jsborderRadius: 6withborderSkipped: 'start', Rechartsradius={[6,6,0,0]}, CSSborder-radius: 6px 6px 0 0.
Step 4: Credibility check (honesty rules, non-negotiable)
Before delivering, check every item. A chart that breaks one of these misleads, even if it looks good.
-
Bar charts start at 0. No truncated or broken bars. (Line charts may zoom the y-axis, but don't exaggerate. Pick the neutral range a fair reader would expect.)
-
Aspect ratio shouldn't fake drama. Avoid very tall, narrow line charts that exaggerate slopes, or very flat ones that hide them.
-
No dual y-axes. Split into two aligned panels with a shared x-axis.
-
Show the full picture. Don't cherry-pick a window that reverses the long-term trend. If you zoom, show the context (a mini overview or a note).
-
Mean vs median: use the one that represents the data. Show the distribution when they differ.
-
Percent changes aren't symmetric (−50% then +50% ≠ back to start). Show absolute levels when it matters.
-
Missing data is shown, never interpolated silently.
-
Rank charts hide gaps. If the size of the differences matters, show values, not just ranks.
-
Avoid: pie charts with more than 3 slices (use a sorted bar), 3D, radar/spider, word clouds (use a bar chart of counts), radial bars, area-scaled bubbles for precise comparisons, and treemaps for precise reading.
-
Uncertainty: show error bars, bands or margins of error where they exist (polls, forecasts, samples).
-
A dip may be seasonal or external. Compare to the same period last year before calling it a trend.
-
Source is cited. Estimates and illustrative data are labeled as such.
-
The title claim is true. Re-check every number, year and comparison in the headline against the data before shipping (e.g. "recovered by 2023" means the 2023 value really is at or above the pre-dip peak). Compute the numbers in code and assert the claim, rather than typing them by hand. Check the claim before drawing or saving: a false claim must stop the chart, not show up after the file is written.
When the title depends on a computed status (ahead / near / behind), write a complete, natural sentence for each branch. Don't slot a status word into a template; that produces lines like "registrations within range of the target".
-
Thresholds aren't rounded into a lie. For "X+", "over X" or "at least X", use the floor, not the rounded value (an average of 3.56 is not "3.6+"). Prefer wording against the real threshold ("above the 3.5 pass mark").
-
Don't single out one item when others tie. If two or more items meet the finding (e.g. 33% and 30% below the mark), name all of them in the title. Call one item the leader ("X is the top", "worst region") only when it beats the next item by at least 15% (
clear_leader(values, i)); otherwise name the group that's close ("A and B lead"). -
Status claims need their benchmark on the chart. "On track", "ahead" or "behind" needs the pace or expected-by-now marker. "No difference" or "within noise" needs confidence intervals drawn, and the CI of the difference stated in the footer.
-
Percentages show their base. State the n behind every % ("62% of sponsors unhappy, 5 of 8 responded"); 50% of 10 isn't 50% of 10,000.
-
Axes run the expected way. No reversed or inverted axes: up and right mean more, unless the convention is universal (e.g. rank 1 at the top), and then say so.
-
"Other" doesn't hide the story. Don't fold a segment into "Other" if it's large or relevant to the finding, and say what "Other" contains in a footnote.
-
Areas match values. In bubbles, icons or pictograms, scale the area (not the width or height) to the value. Lock an equal aspect ratio (
ax.set_aspect('equal'), fixed square cells in CSS) for dot grids, waffles and icon charts so circles stay circles.
Step 5: Deliver
- Write the title sentence → check its claim in code → choose the move(s) from Step 2 → build → run the automatic check (
auto_check(fig)for matplotlib,autoCheck()for web pages, both below) → run the Step 4 checklist → look at the rendered output (open the image or page) and fix overlaps, clipped labels and collisions. Typical collisions: reference-line labels against value labels (put the line label at the right end, outside the bars), end labels against each other (nudge vertically), and annotations against the title. Do both: the automatic checks catch text collisions, legends, rotated labels, axis titles, a blank axis and a missing source, but they can't judge the claim, the chart choice, text sitting on top of bars and lines, or whether a label sits on its mark (measure that; see the alignment rule below). - Direct labels at near-equal values (line ends, both sides of a slope chart) must be spread apart with
spread_labels, never drawn on top of each other. Exactly tied values get one merged label at the shared point ("AI in BFSI · Climate fin. 14%"). When lines converge at the end, label them where they are furthest apart (e.g. at the peak), not at the crowded end. Pass the series names toauto_check(fig, names=[...])orautoCheck(root, names)so a label that went missing is caught. - Alignment: a label sits centred on the mark it describes (its bar row, point or segment), never floating between two marks. Labels for a change between stages (funnel drop-offs, step changes) go on the row of the stage they lead into ("▼ 31% from registered"), not in the gap between bars. Measure it: compare each label's centre with its mark's centre in pixels (it should be about 0). The overlap checker can't see misalignment.
- Annotations go in empty space with a thin leader line. Never put text on top of a bar, a line or a dense area.
- When the first x label sits at the origin, blank the y "0" label (
"" if v == 0 else …in the formatter) so the two don't collide. Change only that label; every other tick keeps its number. - In multi-panel figures, put each panel's label ("Revenue, ₹ Cr") inside its panel at the top-left. Only the top panel carries the title block.
- Use at most 1–2 moves per chart. If you need more, split it into a sequence of charts. In decks, sequence the charts as: what's wrong → what we'll do (with evidence) → what to expect (forecast or target). Build a complex chart up across slides: start simple and add one layer per slide (plain line → target line → highlighted gap).
- When the user asks to "improve" or "fix" an existing chart, show it before → after with one line per change explaining why ("rotated labels → horizontal bars", "legend → direct labels", "added target line").
- Keep a full-detail version available for explore audiences when the explain version drops detail.
Review mode (critiquing an existing chart, deck or dashboard)
When the user asks to review, audit or fix something that already exists, rather than make a new chart:
- Identify the intended message, from the title or by asking. If there isn't one, that's the first finding.
- Check it against Steps 0–4 in order: job, audience and medium; the story move; the house style; then every honesty rule.
- Report in this order: a one-paragraph verdict → honesty problems first (anything misleading, e.g. "the y-axis starts at 60, so a 3% gap looks like 3×") → the top 3 fixes ranked by impact → other issues grouped by step → what already works, named so it's kept.
- For each issue give the element, the problem and the exact fix. When you can build it, show the before → after redraw.
Implementation snippets
matplotlib base style
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm
from matplotlib.patches import FancyBboxPatch, PathPatch
from matplotlib.path import Path
# Validated palette: passes CVD + contrast checks on white and #FAF9F6 (amber = marks only, never text;
# the context greys are deliberately below 3:1 and only for marks that aren't the story)
INK, TEXT, MUTED = "#1F2328", "#3D4249", "#6B6B6B"
GRID, AXIS, CONTEXT, CONTEXT_DARK = "#ECEDEF", "#D5D8DD", "#C9CDD3", "#9AA1AB"
ACCENT, GOOD, AMBER, BLUE = "#C2410C", "#0F7B55", "#B7791F", "#2166AC"
CARD, PAGE = "#FFFFFF", "#F6F7F9"
GREY, DARK, BG = CONTEXT, TEXT, PAGE # short names used by the moves below
TINT = {ACCENT: "#FBE9E2", GOOD: "#E3F2EC", AMBER: "#F8EEDC", BLUE: "#E4EDF7", INK: "#EEF0F2"}
_fonts = {f.name for f in fm.fontManager.ttflist}
FONT = next((f for f in ("Inter", "SF Pro Text", "Roboto", "Segoe UI", "DM Sans") if f in _fonts), "DejaVu Sans")
TITLE_FONT = "Inter Display" if "Inter Display" in _fonts else FONT
plt.rcParams.update({
"font.family": FONT, "font.size": 10.5, "text.color": TEXT,
"figure.facecolor": PAGE, "axes.facecolor": CARD, "savefig.facecolor": PAGE,
"axes.edgecolor": AXIS, "axes.labelcolor": MUTED, "xtick.color": MUTED, "ytick.color": MUTED,
"xtick.labelsize": 9.5, "ytick.labelsize": 9.5, "axes.linewidth": .8,
"axes.spines.top": False, "axes.spines.right": False, "axes.spines.left": False,
"axes.grid": True, "axes.grid.axis": "y", "grid.color": GRID, "grid.linewidth": .8, "axes.axisbelow": True,
"xtick.major.size": 0, "ytick.major.size": 0, "xtick.major.pad": 6, "ytick.major.pad": 6,
"legend.frameon": False, "lines.linewidth": 2.2, "lines.solid_capstyle": "round",
})
def card(fig, pad=0.012):
"""White rounded card behind the whole figure. Call last, after all axes exist."""
fig.add_artist(FancyBboxPatch((pad, pad), 1 - 2 * pad, 1 - 2 * pad, boxstyle="round,pad=0,rounding_size=0.02",
transform=fig.transFigure, fc=CARD, ec="#E6E8EB", lw=1, zorder=-10))
for ax in fig.axes: ax.set_facecolor("none")
def titles(ax, title, subtitle, source=None, kicker=None):
"""Kicker + title + subtitle stacked upward from the axes' top-left; 1-3 line titles never collide.
Leave room with fig.subplots_adjust(top=~0.70)."""
ax.annotate(subtitle, (0, 1), xycoords="axes fraction", xytext=(0, 10), textcoords="offset points",
va="bottom", fontsize=10.5, color=MUTED)
ax.annotate(title, (0, 1), xycoords="axes fraction", xytext=(0, 30), textcoords="offset points",
va="bottom", fontsize=17, color=INK, fontfamily=TITLE_FONT, fontweight="semibold", linespacing=1.2)
if kicker:
ax.annotate(kicker.upper(), (0, 1), xycoords="axes fraction", textcoords="offset points",
xytext=(0, 36 + 23 * (title.count("\n") + 1)), va="bottom", fontsize=8.5, color=ACCENT, fontweight="semibold")
if source: ax.figure.text(0.035, 0.035, f"Source: {source}", fontsize=8, color=MUTED)
def round_bars(ax, bars, r_px=5, horizontal=False):
"""Redraw bars as ONE path each with only the free end rounded (top / right; flips for negatives).
Baseline and stacked joins stay square, and there is no seam. Set axis limits first."""
fig = ax.figure; fig.canvas.draw()
(x0, y0), (x1, y1) = ax.transData.inverted().transform([(0, 0), (1, 1)])
dx, dy = abs(x1 - x0), abs(y1 - y0)
C = [Path.MOVETO, Path.LINETO, Path.CURVE3, Path.CURVE3, Path.LINETO, Path.CURVE3, Path.CURVE3, Path.LINETO, Path.CLOSEPOLY]
out = []
for b in bars:
x, y, w, h = b.get_x(), b.get_y(), b.get_width(), b.get_height(); fc, z = b.get_facecolor(), b.get_zorder(); b.remove()
if horizontal:
L, R, B, T = min(x, x + w), max(x, x + w), y, y + h; rx, ry = min(r_px * dx, R - L), min(r_px * dy, h / 2)
V = ([(L, B), (R - rx, B), (R, B), (R, B + ry), (R, T - ry), (R, T), (R - rx, T), (L, T), (L, B)] if w >= 0 else
[(R, B), (L + rx, B), (L, B), (L, B + ry), (L, T - ry), (L, T), (L + rx, T), (R, T), (R, B)])
else:
L, R, B, T = x, x + w, min(y, y + h), max(y, y + h); rx, ry = min(r_px * dx, w / 2), min(r_px * dy, T - B)
V = ([(L, B), (L, T - ry), (L, T), (L + rx, T), (R - rx, T), (R, T), (R, T - ry), (R, B), (L, B)] if h >= 0 else
[(L, T), (L, B + ry), (L, B), (L + rx, B), (R - rx, B), (R, B), (R, B + ry), (R, T), (L, T)])
p = PathPatch(Path(V, C), fc=fc, ec="none", lw=0, zorder=z); ax.add_patch(p); out.append(p)
return out
def chip(ax, x, y, text, color=ACCENT, **kw):
"""Callout or delta as a rounded tinted chip. Place it centred on the mark it describes."""
kw.setdefault("ha", "center"); kw.setdefault("va", "center")
return ax.annotate(text, (x, y), fontsize=kw.pop("fontsize", 9.5), color=color, fontweight="semibold",
bbox=dict(boxstyle="round,pad=0.35,rounding_size=0.8", fc=TINT.get(color, "#EEF0F2"), ec="none"), **kw)
def end_dot(ax, x, y, color, size=46):
"""Line end (or slope point) marker with a white ring."""
ax.scatter([x], [y], s=size, color=color, edgecolor=CARD, linewidth=2, zorder=5, clip_on=False)
def contrast(a, b="#FFFFFF"):
"""WCAG contrast ratio of two hex colors (text needs >= 4.5, marks >= 3)."""
def lum(h):
c = [int(h[i:i + 2], 16) / 255 for i in (1, 3, 5)]
c = [v / 12.92 if v <= .03928 else ((v + .055) / 1.055) ** 2.4 for v in c]
return .2126 * c[0] + .7152 * c[1] + .0722 * c[2]
hi, lo = sorted([lum(a), lum(b)], reverse=True); return (hi + .05) / (lo + .05)
def clear_leader(values, i, margin=0.15): # rule 15: a 'best'/'worst' title needs a clear lead
s = sorted(values, reverse=True)
if values[i] != s[0]: return False
return len(s) < 2 or s[0] - s[1] >= abs(s[1]) * margin
def spread_labels(ys, min_gap):
"""Nudge label y-positions apart (keeping order). For EXACT ties, merge into one label instead."""
import numpy as np
ys = np.asarray(ys, float); out = ys.copy(); idx = np.argsort(ys)
for _ in range(50):
moved = False
for a, b in zip(idx[:-1], idx[1:]):
if out[b] - out[a] < min_gap:
d = (min_gap - (out[b] - out[a])) / 2; out[a] -= d; out[b] += d; moved = True
if not moved: break
return out
def claim(cond, msg): # check a title claim BEFORE drawing
if not cond: raise ValueError(f"Title claim is false: {msg}")
def end_label(ax, x, y, text, color): # direct label instead of legend
ax.annotate(text, (x, y), xytext=(6, 0), textcoords="offset points", va="center", color=color, fontweight="bold")
Common moves
# Shade the difference between two lines, colored by who leads
ax.fill_between(x, a, b, where=a>=b, color=ACCENT, alpha=.18, interpolate=True)
ax.fill_between(x, a, b, where=a<b, color=BLUE, alpha=.18, interpolate=True)
# Forecast: dashed line + confidence band + divider
ax.plot(xf, yf, ls="--", color=ACCENT); ax.fill_between(xf, lo, hi, color=ACCENT, alpha=.15)
ax.axvline(x_today, color=GREY, ls=":"); ax.axvspan(x_today, xf[-1], color="#000", alpha=.04)
# Explain a dip with a labeled band
ax.axvspan(t0, t1, color=ACCENT, alpha=.12); ax.text((t0+t1)/2, ax.get_ylim()[1], "Data outage", ha="center", va="top", color=ACCENT)
# Vs target: grey bars at true height; excess solid green, shortfall hatched/hollow red
for c, v in zip(cats, vals):
d = v - target
ax.bar(c, min(v, target), color=GREY)
if d > 0: ax.bar(c, d, bottom=target, color=GOOD)
else: ax.bar(c, -d, bottom=v, facecolor="none", edgecolor=ACCENT, hatch="///", lw=1)
ax.text(c, max(v, target)+1, f"{d:+}", ha="center", va="bottom", color=GOOD if d>0 else ACCENT, fontweight="bold")
ax.axhline(target, ls="--", color=DARK, lw=1)
ax.text(len(cats)-0.5, target, "Target", va="bottom", ha="right", color=DARK) # just above the line, right end
ax.set_xlim(-0.6, len(cats)-0.4)
# Highlight one series, grey the rest
for name, s in series.items():
hl = name == focus
ax.plot(s.index, s, color=ACCENT if hl else GREY, lw=2.5 if hl else 1, zorder=3 if hl else 1)
Bracket for a group of bars (instead of a legend)
def bracket(ax, x, bar_idx, text, color, tick=None): # spans the bars at these plotted positions (barh: bottom bar = 0)
tick = tick or (ax.get_xlim()[1] * 0.015)
y0, y1 = min(bar_idx) - .35, max(bar_idx) + .35
ax.plot([x, x+tick, x+tick, x], [y0, y0, y1, y1], color=color, lw=1.3, clip_on=False)
ax.text(x + tick*2.2, (y0+y1)/2, text, color=color, va="center", fontweight="bold")
# Derive bar_idx from the same list you colored, e.g. [i for i, c in enumerate(colors) if c == ACCENT].
# Never type the positions by hand; barh plots bottom-up, so hand-typed spans land on the wrong bars.
# Set xlim first (the tick size uses it), then widen it so the text fits.
(Don't use matplotlib's -[ arrowstyle for this. It draws a horizontal bracket with a stem.)
Auto-check before delivering (matplotlib)
import itertools
from matplotlib.text import Text
def auto_check(fig, names=()):
"""Returns a list of rule breaks. Pass the series names that must be visible on screen."""
fig.canvas.draw(); issues = []
T = [(t, t.get_window_extent()) for t in fig.findobj(Text) if t.get_visible() and t.get_text().strip()]
T = [(t, b) for t, b in T if b.width > 1 and b.height > 1]
for (a, ba), (b, bb) in itertools.combinations(T, 2):
ticks = a.axes and a.axes is b.axes and {a, b} <= set(a.axes.get_xticklabels() + a.axes.get_yticklabels())
if not ticks and ba.padded(-2).overlaps(bb.padded(-2)):
issues.append(f"text overlap: {a.get_text()[:25]!r} x {b.get_text()[:25]!r}")
for ax in fig.axes:
if ax.get_legend() and len(ax.get_legend().get_texts()) < 5:
issues.append("legend used for <5 series: label lines and bars directly")
if ax.get_ylabel().strip(): issues.append("y-axis title: move the units into the subtitle")
if any(l.get_text() and l.get_rotation() % 360 for l in ax.get_xticklabels() + ax.get_yticklabels()):
issues.append("rotated tick labels")
yl = [l.get_text().strip() for l in ax.get_yticklabels() if l.get_visible()]
if yl and not any(yl) and any(g.get_visible() for g in ax.get_ygridlines()):
issues.append("y axis has gridlines but no numbers")
if not any(t.get_text().lower().startswith("source") for t, _ in T): issues.append("no source line")
shown = " ".join(t.get_text() for t, _ in T)
issues += [f"series not named on screen: {n!r}" for n in names if n not in shown]
return issues
Using it in any tool or stack
Steps 0–4 are the skill, and they don't depend on any tool. The Python snippets above are one implementation. Every move in the catalog is built from the same five primitives, so translate those into whatever stack is in use:
| Primitive | What it is |
|---|---|
| Reference line | Target, pass mark, average, "today": a dashed line plus a short label at its end |
| Shaded band/area | Event window, forecast region, gap between two series, quadrant region (15–25% tint) |
| Direct label | Text next to the mark (line end, bar end, point), in the mark's color if readable or dark text with a colored marker, instead of a legend |
| Highlight | One series/bar/point in the accent color; everything else grey |
| Text block | Title (the finding) → subtitle (metric, units, period) → source footer |
| Stack | How to build the primitives |
|---|---|
| D3 / raw SVG | line/rect/text elements; you control every position, so apply the spread_labels logic to end labels |
| Chart.js | chartjs-plugin-annotation (line, box, label); plugins.legend.display = false; the datalabels plugin for direct labels |
| ECharts | markLine, markArea, series label/endLabel; legend.show = false. symbol: 'none' also hides data labels: to label one point use symbol: 'circle', showSymbol: true and symbolSize 0 except at the labelled index |
| Recharts | ReferenceLine, ReferenceArea, LabelList; omit <Legend/> |
| Plotly | shapes (line/rect), annotations, showlegend: false, yaxis.rangemode: "tozero" for bars |
| Vega-Lite | layer rule and rect marks with text marks; legend: null |
| Excel / Google Sheets / PowerPoint | Extra series for target lines and bands; data labels "value from cells" for direct labels; delete the legend; the finding as chart title |
| SwiftUI Charts | RuleMark, RectangleMark, .annotation(position:) on marks; .chartLegend(.hidden) |
| Flutter / Jetpack Compose | Extra horizontal/vertical lines or range annotations in the chart library, or custom drawing for bands; text painters for direct labels |
| Figma / design mockups | Same rules as static charts. Use realistic numbers that pass the claim check, and label sample data as sample. |
Extra rules for web and app interfaces
- Small screens (under ~480px wide): switch to horizontal bars, cut x ticks to 3–5, wrap the title to at most 2 lines, keep only the one annotation that carries the story, and move secondary detail behind a tap. KPI tiles go in a 2×2 grid, not one squeezed row.
- Touch: no hover-only information. The key value and the finding are always visible; tap reveals extra detail.
- Dark mode: re-derive the greys and the accent for the dark background rather than inverting them. Keep text contrast ≥ 4.5:1 and mark contrast ≥ 3:1 against the background.
- Accessibility: give the chart container
role="img"and anaria-labelwith the title sentence, offer a data table fallback, and keep patterns or direct labels so color isn't the only cue. - Number formatting: use the locale's formatter (
Intl.NumberFormator the platform equivalent). For Indian audiences, consider lakh/crore (₹4.8 Cr) instead of millions. - Motion: no decorative animation. Use short transitions (≤ 300ms) only to show what changed between states.
- Live and filtered dashboards: mark partial periods and the last-updated time. Every piece of text that states a finding (the page headline, chart titles, recommended actions, notes) is recomputed and claim-checked on every filter change and data refresh, never written once for the default view. If a claim isn't true for the current state, switch to a neutral title, and drop any action the data no longer supports. Keep the axis scale fixed across filter states (Step 3).
Auto-check before delivering (web pages, SVG or HTML charts)
Run it in the browser console or the page's test. It reads SVG and HTML text. For canvas-based charts (default Chart.js, ECharts in canvas mode), switch the renderer to SVG for the check, or review a screenshot by eye.
function autoCheck(root = document, names = []) {
const els = [...root.querySelectorAll('svg text, [data-chart-text]')]
.filter(e => e.textContent.trim() && e.getBoundingClientRect().width > 1);
const r = els.map(e => e.getBoundingClientRect()), issues = [];
for (let i = 0; i < els.length; i++) for (let j = i + 1; j < els.length; j++) {
const a = r[i], b = r[j];
if (els[i].contains(els[j]) || els[j].contains(els[i])) continue;
if (a.left + 2 < b.right && b.left + 2 < a.right && a.top + 2 < b.bottom && b.top + 2 < a.bottom)
issues.push(`text overlap: "${els[i].textContent.trim().slice(0, 25)}" x "${els[j].textContent.trim().slice(0, 25)}"`);
}
if (root.querySelector('[class*="legend" i]')) issues.push('legend present: fine for 5+ series or a required design system; otherwise label lines and bars directly');
const leaf = [...root.querySelectorAll('*')].filter(e => !e.children.length);
if (!leaf.some(e => /^\s*source/i.test(e.textContent))) issues.push('no source line');
const shown = els.map(e => e.textContent).join(' ');
names.filter(n => !shown.includes(n)).forEach(n => issues.push(`series not named on screen: "${n}"`));
return issues;
}
Mark chart text that lives in HTML (KPI values, labels in divs) with data-chart-text so the check sees it.
- KPI tile markup: big number → delta line (▲/▼ + % + "vs last month", colored) → sparkline or bullet bar to target → tiny caption with the benchmark.
View original Markdown
---
name: "honest-story-charts"
description: "Make any chart, KPI tile, dashboard or app/web data view lead with its takeaway and stay honest. Use for every chart, in any tool or stack."
---
# Honest story charts
Default AI charts dump the data: every series in a rainbow palette, a legend, a generic title, gridlines everywhere and no conclusion. This skill makes every chart **lead with its takeaway**, so the reader gets the message in about 3 seconds, and keeps it **honest**, so the message survives scrutiny.
Every chart can be built two ways:
| Default chart (avoid) | Story chart (this skill) |
|---|---|
| All series equally loud | One thing in color, everything else grey |
| Title names the metric ("Revenue by month") | Title states the finding ("Revenue fell 37% short of plan") |
| Legend box | Labels sit right next to the lines and bars |
| Bare number ("$4.2M") | Number with something to compare it to ("$4.2M ▼15% vs last month, target $5.4M") |
| The reader has to work out the story | Annotation, band, bracket or reference line carries the story |
Use this skill with any charting stack (matplotlib, Plotly, D3, Chart.js, Excel, slides, HTML dashboards). If a palette/dataviz skill or a brand design system is loaded too, take colors and fonts from it and the storytelling and honesty rules from here. See **Using it in any tool or stack** at the end.
---
## Step 0: Decide the job, explain or explore
Ask yourself (or the user, if unclear) who the chart is for:
- **Explain** (execs, clients, slide decks, social posts, "so what should we do?"): pick ONE story, highlight it, and put the conclusion in the title. This is the default.
- **Explore** (analysts, scientists, reference dashboards, appendices): show all the data evenly, with error bars and precise axes, and let readers find their own insights. Neutral title.
One chart can't do both well. The audience decides the dressing:
- Scientist/academic: error bars, full axes, neutral title, methods note.
- Consultant/exec: sorted bars, the top items in color and the rest grey, a takeaway headline, values printed on the bars.
- Never pick a chart because it looks fancy (radar, 3D, pie).
- Ask **how it will be delivered**, because the medium changes the dressing: a live talk gets a sparse chart (you narrate); a read-alone report or email needs more annotation and must explain itself; a dashboard has no presenter, so overview first and detail on demand; a social post carries one idea in big text.
- Ask **what the reader should do** after seeing it. In explain mode, the subtitle or a closing annotation states the recommended action when there is one.
## Step 1: Write the "so what" sentence first
Before choosing a chart, write one sentence: *"[Subject] [did what] [by how much] [compared to what / why]."*
- Good: "Store E drove 31% of annual sales, peaking in July."
- Bad: "Sales by store and month."
That sentence becomes the **title**. The subtitle holds the metric, units and time range. If you can't write the sentence, you're in explore mode (Step 0).
Three quick tests once it's built:
- **Glance test:** where do your eyes land first? That must be the point.
- **Greyscale test:** does the message survive without color?
- **Titles-only test** (decks and dashboards): read only the titles in order. They should tell the whole story, and each chart should still make sense on its own.
## Step 2: Find the story type, then apply its move
Match the "so what" to a row below and apply that technique. This catalog is the core of the skill.
### Lines over time
| Story | Move |
|---|---|
| **Difference** between two series | Shade the area between the lines, using each series' color for the stretch where it leads. |
| **Shortfall / gap vs plan** | Plan as a dashed line, shade the gap, and label the end with something like "Shortfall −37%" in the accent color. |
| **Forecast** | Solid actuals, dashed forecast. Add a vertical "Today" divider and a light grey box behind the forecast region, labeled "Actual" and "Forecast". |
| **Confidence** | A fan or band around the forecast (darker inner band, lighter outer band), or error bars on points. |
| **Recovery / drawdowns** | Shade each dip and label how long it took to recover ("20 days", "14 days"). |
| **Seasonality** | Overlay the years on one Jan–Dec axis. Current year in color, prior years in grey, each labeled at its line end. |
| **Reason for a dip or spike** | A shaded vertical band over the period, labeled with the cause ("Data outage", "Holiday sales"). |
| **Event / turning point** | A dashed vertical line labeled "Event X". Color the line after the event in the accent color. |
| **Several events** | Dots at each event with short labels ("Event A/B/C") and no legend. |
| **Signal in noise / one of many lines** | Every line grey and thin, the one that matters thick and in color, labeled directly. |
| **Spaghetti (4+ crossing lines)** | Small multiples, one panel per series, same axes. |
| **Leaders over time** | Shaded bands showing which series led in which period, plus the crossover dates. |
| **Movers between two points** | A slope chart (start to end) with labels and values on both ends. Color risers vs fallers. |
| **Missing data** | Never connect straight through a gap silently. Use a dashed connector, grey out the missing x-labels and annotate "missing data 2021–22". |
| **Live / partial data** | Mark the incomplete current period (hatched or lighter, "partial month"). |
| **Many similar series** | Group the small multiples by pattern into labeled panels: **Rising / Falling / Steady**. |
### Bars and categories
| Story | Move |
|---|---|
| **Vs target** | Bars in grey at their true height, target as a dashed line. The part **above** the target is solid green. A **shortfall** is drawn as a light, hatched or outlined red "missing" segment from the bar top up to the target, so the bar still reads at its real value. Put "+7" / "−12" labels at the target line. |
| **Over budget / excess** | Grey bars, and only the part above the budget line in red, with its value. |
| **Concentration / top items** | Color the top N, grey the rest, add a bracket or brace with "28% of total". |
| **Long tail** | Show the top N and collapse the rest into a grey "Others" bar. |
| **Ranking** | Sort descending, horizontal bars, values at the bar ends, no x-axis. |
| **Span between two values per item** | A dumbbell or range bar instead of grouped bars. Label both ends. |
| **Evaluation / score vs max** | Bars over a full-length grey track to 100%, colored by tier (green/amber/red). |
| **Performance vs target per item** | A bullet chart: grey ranges, a dark bar for the actual, a tick for the target. |
| **Proportions AND sizes** | Stacked 100% bars with column width proportional to the total (Marimekko), or totals labeled above. |
| **Groups** | Color by group, not by bar. Leave a gap between groups. |
| **One standout** | Everything grey, the standout in the accent color with a direct label. |
| **Part of a whole (%)** | One stacked bar: accent for the share, grey for the remainder. Use a waffle (10×10) instead of a pie for one share. |
| **Likert / agree–disagree** | Diverging stacked bars anchored on a center line. Put **neutral in its own column**, not split across the center. |
| **Mean hides the story** | Show the distribution (strip, beeswarm, box plot or ECDF) instead of a bar of averages. Compare medians when the data is skewed. |
| **Ratings on a small fixed scale (1–5, 1–10, NPS)** | Don't jitter dots, because they stack into flat lines. Use diverging share bars (% below the pass mark on the left, % at or above it on the right), sorted worst first, with "avg 3.7" printed as context at the bar end. |
| **How we got from A to B** | A waterfall (bridge): start and end totals in grey, increases in green, decreases in red, each step labeled with its value. |
| **One number** | Not a chart. Use a stat tile (big number plus a comparison). Never a one-bar chart or a two-slice pie. |
| **Stages with drop-off** | A funnel: bars in stage order with the drop-off % between steps, the worst drop in the accent color. Use a Sankey only when flows split and merge. |
| **Where (geography)** | A map with one sequential hue and a labeled scale; label only the regions the story is about. Use a sorted bar chart instead when exact comparison matters more than location. |
### Distributions, scatter, density
| Story | Move |
|---|---|
| **Distribution shape** | A density curve with a rug of the raw values as ticks underneath. |
| **Many distributions** | A ridgeline, colored per group, if overlap is moderate. Otherwise use box plots. |
| **Threshold / pass mark** | Dots per group, a dashed pass line, dots below it in red, and the "% below" printed under each group. |
| **Scatter meaning** | Split it into labeled quadrant regions, lightly tinted (e.g. Quick wins / Major projects / Fill-ins / Avoid). In explain mode, label **only the points the story is about**, in the accent color, and leave the rest as unlabeled grey dots. Labeling every point causes collisions. |
| **Overplotted scatter** | A hexbin or 2D density instead of thousands of dots. |
| **Trend in noisy scatter** | A LOESS smooth over light points. Don't zigzag-connect the dots. Skip it for small or seasonal data. |
| **Wide value range** | Log scale, and say "log scale" on the axis. |
### Heatmaps, tables, KPI tiles, dashboards
| Story | Move |
|---|---|
| **Heatmap** | Add marginal total bars (a row on top, a column on the right). Call out the top cell, row and column in dark with a label ("best month", "top store"). |
| **Table** | Keep the table, but highlight the key cells and add a sparkline "trend" column. |
| **KPI number** | Never a bare number. Add at least one comparison: **vs past** (sparkline + "▼15% vs last month"), **vs target** (bullet bar to target, with the gap labeled), **vs peer** (two bars), or **vs a good range** (Weak/Fair/Strong gauge with a marker). Color the delta: green good, red bad, judged by direction-of-good, not by sign. |
| **Dashboard** | (1) One view = one decision or topic, so cut everything else. (2) **Hierarchy**: one hero tile, larger and top-left, with supporting tiles smaller. (3) **Group related tiles** under section headers (Revenue / Audience / Performance) with light tinted panels. (4) **Anchor** every number with a benchmark, target or prior period. (5) Lay out in a Z-pattern: most important at the top-left, details at the bottom-right. (6) Mark live or incomplete data. (7) The tile the headline is about gets a light accent tint and border, plus a short status tag ("needs action") on the big-number row. Narrow tiles have no room for it on the label row. (8) For a cumulative KPI against a deadline, the target bar shows a **pace marker** (the share of the target that should be reached by today). (9) In explain-mode dashboards (one story, exec audience), show 3–6 KPI tiles and no more than about 5 visuals above the fold; detail goes to drill-down. Analyst (explore) dashboards can go deeper, but still through drill-down rather than more panels on the first screen. (10) When filters are applied, say so in the subtitle ("Day 2 only · South region"). (11) Show an "as of" timestamp and the data source in the footer. |
| **Interactive (web)** | Prefer always-visible direct labels over hover-only tooltips, since hover isn't accessible. Use hover, drill-down, a brush window or a variable target line only as extras. On web, still add a hover/tap tooltip with exact values by default; it's an extra, never the only place a key value lives. |
## Step 3: Apply the house style
**Color**
- Base everything in neutral grey: context marks `#C9CDD3` (`#9AA1AB` for a second context level), text `#3D4249`, title `#1F2328`, muted text `#6B6B6B`. Use **one accent** (`#C2410C`, or the brand color once validated) for the point, and a second color (blue `#2166AC`) only when comparing two things.
- Good/bad: green `#0F7B55` / red-orange `#C2410C`, amber `#B7791F` for the middle. Amber is for marks only: it fails 4.5:1 as text, so amber items get dark text labels. These colors pass colorblind separation and contrast on white and `#FAF9F6`. The context greys are the deliberate exception: `#C9CDD3` (1.6:1) and `#9AA1AB` (2.6:1) sit below 3:1 so they recede. Use them only for marks that aren't the story, and never let a grey mark be the only carrier of a value the reader needs (label it). Light tints for bands, regions and chips: `#FBE9E2`, `#E3F2EC`, `#F8EEDC`, `#E4EDF7`.
- Swapping in a brand color? Check it before use with `contrast()` (≥ 4.5 for text, ≥ 3 for marks), and check that it stays distinct from the other colors under colorblind simulation.
- Same group = same hue family. Never a rainbow for categories that aren't the story.
- **Match the color type to its job:** categories get distinct hues in a fixed order; magnitude gets one hue, light to dark; above/below a midpoint gets two opposite hues (warm vs cool) with a neutral grey middle. Never a rainbow, and never a light-to-dark ramp on categories that have no order.
- **Color follows the entity, not its rank.** When a filter removes a series, the remaining series keep their colors.
- More than about 7 colored categories: fold the tail into "Other", split into small multiples, or use a table.
- Accessibility: never rely on color alone. Add **patterns/hatching** for shaded categories, direct labels and different markers. Check colorblind safety by computing it, not by eye: run the final colors through a colorblind simulation or palette checker.
**Ink**
- Background: the chart sits on a white card over a soft page (`#F6F7F9`), or plain white / warm off-white (`#FAF9F6`). No 3D, no gradients, no shadows, no bar outlines (the hatched shortfall segment is the one exception).
- Gridlines: hairline horizontal only (`#ECEDEF`), drawn behind the marks, or none when values are labeled. No vertical gridlines on time series.
- Axis line only on the baseline. Drop tick marks. Format numbers with K/M/B and minimal decimals (keep precision for finance, science and engineering).
- **Labels next to the data instead of legends**: put the series name at the end of each line. Give the label the series color only if that color passes 4.5:1 contrast against the background; otherwise use dark text next to a small colored marker. With 5+ series, or when a house design system requires a legend, keep a small legend and still direct-label the series the story is about.
- Sort bars by value unless the categories have a natural order (time, stages, a scale). Panels meant to be compared share **one category order** (sort by the total or by the first panel, never each panel separately) and **one scale**. On dashboards with filters, fix the axis maximum to the largest value across every filter state, totals included, so bars don't silently rescale when the filter changes.
- Separate adjacent bars and stacked segments with a thin gap in the background color, not a border.
- Minimum text size: 11–12px on screen, 14px+ on presentation slides.
- Horizontal text only. **Never rotate labels 45°.** Use horizontal bars, or wrap and abbreviate labels.
- Units go in the **subtitle** ("Daily app installs (count)", "Revenue, $M"), or in the top tick label ("1,000 installs"). Don't add a separate y-axis title above the plot, because it collides with the subtitle. Never rotate an axis title.
**Text**
- Title = the takeaway (bold, around 18–20px), under about 60 characters or wrapped onto two lines. It must never be clipped by the chart width. Subtitle = metric, units and period (grey, around 13px).
- Annotations go in the accent color, in plain short text, placed next to the mark they explain. Use a thin leader line if needed. Keep them **inside the plot area**, never in the title/subtitle band, including annotations on marginal or side panels.
- Brackets/braces label groups of bars or ranges right where the eye lands, instead of a legend.
- Footer: "Source: …" plus notes on missing data, log scale or estimates, small and grey. **Always include a source.**
**Shapes**
- Use dashed lines for forecast, plan, target, missing data and reference lines. Use solid lines for actuals.
- Highlight a time window with a shaded band and give it a label inside the band at the top.
**Modern finish (never ship a library's default look)**
The story comes first, but style decides whether people trust and share the chart. Every chart gets this finish:
- **Type:** Inter, or the platform UI font (SF Pro, Roboto, Segoe UI). Title semibold 17–20px in `#1F2328`; an optional small uppercase **kicker** above it in the accent color ("FUNNEL · Q3"); subtitle in `#6B6B6B`.
- **Frame:** a white rounded card (radius about 12px, 1px `#E6E8EB` border) on a soft page `#F6F7F9`. No drop shadows.
- **Bars:** round only the free end (4–6px); keep the baseline and stacked joins square. Draw each bar as one shape so no seam shows (`round_bars`). Leave a thin gap between bars.
- **Lines:** 2–2.5px with round caps. Put an end dot with a 2px white ring on the highlighted series (`end_dot`). An optional soft fill (8–12% tint) under the hero line.
- **Callouts and deltas:** tinted chips (`chip`): text in the color, background its light tint. Delta badges like "▲ 12%" in good or bad color.
- **Axes:** text `#6B6B6B` at 9.5–11px, no tick marks, hairline grid.
- **Web and apps:** the same tokens as CSS variables. Rounded bar ends: ECharts `itemStyle.borderRadius: [6,6,0,0]`, Chart.js `borderRadius: 6` with `borderSkipped: 'start'`, Recharts `radius={[6,6,0,0]}`, CSS `border-radius: 6px 6px 0 0`.
## Step 4: Credibility check (honesty rules, non-negotiable)
Before delivering, check every item. A chart that breaks one of these misleads, even if it looks good.
1. **Bar charts start at 0.** No truncated or broken bars. (Line charts may zoom the y-axis, but don't exaggerate. Pick the neutral range a fair reader would expect.)
2. **Aspect ratio** shouldn't fake drama. Avoid very tall, narrow line charts that exaggerate slopes, or very flat ones that hide them.
3. **No dual y-axes.** Split into two aligned panels with a shared x-axis.
4. **Show the full picture.** Don't cherry-pick a window that reverses the long-term trend. If you zoom, show the context (a mini overview or a note).
5. **Mean vs median**: use the one that represents the data. Show the distribution when they differ.
6. **Percent changes aren't symmetric** (−50% then +50% ≠ back to start). Show absolute levels when it matters.
7. **Missing data is shown**, never interpolated silently.
8. **Rank charts hide gaps.** If the size of the differences matters, show values, not just ranks.
9. **Avoid**: pie charts with more than 3 slices (use a sorted bar), 3D, radar/spider, word clouds (use a bar chart of counts), radial bars, area-scaled bubbles for precise comparisons, and treemaps for precise reading.
10. **Uncertainty**: show error bars, bands or margins of error where they exist (polls, forecasts, samples).
11. **A dip may be seasonal or external.** Compare to the same period last year before calling it a trend.
12. **Source** is cited. Estimates and illustrative data are labeled as such.
13. **The title claim is true.** Re-check every number, year and comparison in the headline against the data before shipping (e.g. "recovered by 2023" means the 2023 value really is at or above the pre-dip peak). Compute the numbers in code and assert the claim, rather than typing them by hand. Check the claim **before drawing or saving**: a false claim must stop the chart, not show up after the file is written.
When the title depends on a computed status (ahead / near / behind), write a complete, natural sentence for each branch. Don't slot a status word into a template; that produces lines like "registrations within range of the target".
14. **Thresholds aren't rounded into a lie.** For "X+", "over X" or "at least X", use the floor, not the rounded value (an average of 3.56 is not "3.6+"). Prefer wording against the real threshold ("above the 3.5 pass mark").
15. **Don't single out one item when others tie.** If two or more items meet the finding (e.g. 33% and 30% below the mark), name all of them in the title. Call one item the leader ("X is the top", "worst region") only when it beats the next item by at least 15% (`clear_leader(values, i)`); otherwise name the group that's close ("A and B lead").
16. **Status claims need their benchmark on the chart.** "On track", "ahead" or "behind" needs the pace or expected-by-now marker. "No difference" or "within noise" needs confidence intervals drawn, and the CI of the difference stated in the footer.
17. **Percentages show their base.** State the n behind every % ("62% of sponsors unhappy, 5 of 8 responded"); 50% of 10 isn't 50% of 10,000.
18. **Axes run the expected way.** No reversed or inverted axes: up and right mean more, unless the convention is universal (e.g. rank 1 at the top), and then say so.
19. **"Other" doesn't hide the story.** Don't fold a segment into "Other" if it's large or relevant to the finding, and say what "Other" contains in a footnote.
20. **Areas match values.** In bubbles, icons or pictograms, scale the area (not the width or height) to the value. Lock an equal aspect ratio (`ax.set_aspect('equal')`, fixed square cells in CSS) for dot grids, waffles and icon charts so circles stay circles.
## Step 5: Deliver
- Write the title sentence → check its claim in code → choose the move(s) from Step 2 → build → run the automatic check (`auto_check(fig)` for matplotlib, `autoCheck()` for web pages, both below) → run the Step 4 checklist → look at the rendered output (open the image or page) and fix overlaps, clipped labels and collisions. Typical collisions: reference-line labels against value labels (put the line label at the right end, outside the bars), end labels against each other (nudge vertically), and annotations against the title. Do both: the automatic checks catch text collisions, legends, rotated labels, axis titles, a blank axis and a missing source, but they can't judge the claim, the chart choice, text sitting on top of bars and lines, or whether a label sits on its mark (measure that; see the alignment rule below).
- Direct labels at near-equal values (line ends, both sides of a slope chart) must be spread apart with `spread_labels`, never drawn on top of each other. Exactly tied values get **one merged label** at the shared point ("AI in BFSI · Climate fin. 14%"). When lines converge at the end, label them where they are furthest apart (e.g. at the peak), not at the crowded end. Pass the series names to `auto_check(fig, names=[...])` or `autoCheck(root, names)` so a label that went missing is caught.
- **Alignment:** a label sits centred on the mark it describes (its bar row, point or segment), never floating between two marks. Labels for a change between stages (funnel drop-offs, step changes) go on the row of the stage they lead into ("▼ 31% from registered"), not in the gap between bars. Measure it: compare each label's centre with its mark's centre in pixels (it should be about 0). The overlap checker can't see misalignment.
- Annotations go in empty space with a thin leader line. Never put text on top of a bar, a line or a dense area.
- When the first x label sits at the origin, blank the y "0" label (`"" if v == 0 else …` in the formatter) so the two don't collide. Change only that label; every other tick keeps its number.
- In multi-panel figures, put each panel's label ("Revenue, ₹ Cr") **inside** its panel at the top-left. Only the top panel carries the title block.
- Use **at most 1–2 moves per chart.** If you need more, split it into a sequence of charts. In decks, sequence the charts as: what's wrong → what we'll do (with evidence) → what to expect (forecast or target). Build a complex chart up across slides: start simple and add one layer per slide (plain line → target line → highlighted gap).
- When the user asks to "improve" or "fix" an existing chart, show it **before → after** with one line per change explaining why ("rotated labels → horizontal bars", "legend → direct labels", "added target line").
- Keep a full-detail version available for explore audiences when the explain version drops detail.
## Review mode (critiquing an existing chart, deck or dashboard)
When the user asks to review, audit or fix something that already exists, rather than make a new chart:
1. Identify the intended message, from the title or by asking. If there isn't one, that's the first finding.
2. Check it against Steps 0–4 in order: job, audience and medium; the story move; the house style; then every honesty rule.
3. Report in this order: a one-paragraph verdict → **honesty problems first** (anything misleading, e.g. "the y-axis starts at 60, so a 3% gap looks like 3×") → the top 3 fixes ranked by impact → other issues grouped by step → what already works, named so it's kept.
4. For each issue give the element, the problem and the exact fix. When you can build it, show the before → after redraw.
---
## Implementation snippets
### matplotlib base style
```python
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm
from matplotlib.patches import FancyBboxPatch, PathPatch
from matplotlib.path import Path
# Validated palette: passes CVD + contrast checks on white and #FAF9F6 (amber = marks only, never text;
# the context greys are deliberately below 3:1 and only for marks that aren't the story)
INK, TEXT, MUTED = "#1F2328", "#3D4249", "#6B6B6B"
GRID, AXIS, CONTEXT, CONTEXT_DARK = "#ECEDEF", "#D5D8DD", "#C9CDD3", "#9AA1AB"
ACCENT, GOOD, AMBER, BLUE = "#C2410C", "#0F7B55", "#B7791F", "#2166AC"
CARD, PAGE = "#FFFFFF", "#F6F7F9"
GREY, DARK, BG = CONTEXT, TEXT, PAGE # short names used by the moves below
TINT = {ACCENT: "#FBE9E2", GOOD: "#E3F2EC", AMBER: "#F8EEDC", BLUE: "#E4EDF7", INK: "#EEF0F2"}
_fonts = {f.name for f in fm.fontManager.ttflist}
FONT = next((f for f in ("Inter", "SF Pro Text", "Roboto", "Segoe UI", "DM Sans") if f in _fonts), "DejaVu Sans")
TITLE_FONT = "Inter Display" if "Inter Display" in _fonts else FONT
plt.rcParams.update({
"font.family": FONT, "font.size": 10.5, "text.color": TEXT,
"figure.facecolor": PAGE, "axes.facecolor": CARD, "savefig.facecolor": PAGE,
"axes.edgecolor": AXIS, "axes.labelcolor": MUTED, "xtick.color": MUTED, "ytick.color": MUTED,
"xtick.labelsize": 9.5, "ytick.labelsize": 9.5, "axes.linewidth": .8,
"axes.spines.top": False, "axes.spines.right": False, "axes.spines.left": False,
"axes.grid": True, "axes.grid.axis": "y", "grid.color": GRID, "grid.linewidth": .8, "axes.axisbelow": True,
"xtick.major.size": 0, "ytick.major.size": 0, "xtick.major.pad": 6, "ytick.major.pad": 6,
"legend.frameon": False, "lines.linewidth": 2.2, "lines.solid_capstyle": "round",
})
def card(fig, pad=0.012):
"""White rounded card behind the whole figure. Call last, after all axes exist."""
fig.add_artist(FancyBboxPatch((pad, pad), 1 - 2 * pad, 1 - 2 * pad, boxstyle="round,pad=0,rounding_size=0.02",
transform=fig.transFigure, fc=CARD, ec="#E6E8EB", lw=1, zorder=-10))
for ax in fig.axes: ax.set_facecolor("none")
def titles(ax, title, subtitle, source=None, kicker=None):
"""Kicker + title + subtitle stacked upward from the axes' top-left; 1-3 line titles never collide.
Leave room with fig.subplots_adjust(top=~0.70)."""
ax.annotate(subtitle, (0, 1), xycoords="axes fraction", xytext=(0, 10), textcoords="offset points",
va="bottom", fontsize=10.5, color=MUTED)
ax.annotate(title, (0, 1), xycoords="axes fraction", xytext=(0, 30), textcoords="offset points",
va="bottom", fontsize=17, color=INK, fontfamily=TITLE_FONT, fontweight="semibold", linespacing=1.2)
if kicker:
ax.annotate(kicker.upper(), (0, 1), xycoords="axes fraction", textcoords="offset points",
xytext=(0, 36 + 23 * (title.count("\n") + 1)), va="bottom", fontsize=8.5, color=ACCENT, fontweight="semibold")
if source: ax.figure.text(0.035, 0.035, f"Source: {source}", fontsize=8, color=MUTED)
def round_bars(ax, bars, r_px=5, horizontal=False):
"""Redraw bars as ONE path each with only the free end rounded (top / right; flips for negatives).
Baseline and stacked joins stay square, and there is no seam. Set axis limits first."""
fig = ax.figure; fig.canvas.draw()
(x0, y0), (x1, y1) = ax.transData.inverted().transform([(0, 0), (1, 1)])
dx, dy = abs(x1 - x0), abs(y1 - y0)
C = [Path.MOVETO, Path.LINETO, Path.CURVE3, Path.CURVE3, Path.LINETO, Path.CURVE3, Path.CURVE3, Path.LINETO, Path.CLOSEPOLY]
out = []
for b in bars:
x, y, w, h = b.get_x(), b.get_y(), b.get_width(), b.get_height(); fc, z = b.get_facecolor(), b.get_zorder(); b.remove()
if horizontal:
L, R, B, T = min(x, x + w), max(x, x + w), y, y + h; rx, ry = min(r_px * dx, R - L), min(r_px * dy, h / 2)
V = ([(L, B), (R - rx, B), (R, B), (R, B + ry), (R, T - ry), (R, T), (R - rx, T), (L, T), (L, B)] if w >= 0 else
[(R, B), (L + rx, B), (L, B), (L, B + ry), (L, T - ry), (L, T), (L + rx, T), (R, T), (R, B)])
else:
L, R, B, T = x, x + w, min(y, y + h), max(y, y + h); rx, ry = min(r_px * dx, w / 2), min(r_px * dy, T - B)
V = ([(L, B), (L, T - ry), (L, T), (L + rx, T), (R - rx, T), (R, T), (R, T - ry), (R, B), (L, B)] if h >= 0 else
[(L, T), (L, B + ry), (L, B), (L + rx, B), (R - rx, B), (R, B), (R, B + ry), (R, T), (L, T)])
p = PathPatch(Path(V, C), fc=fc, ec="none", lw=0, zorder=z); ax.add_patch(p); out.append(p)
return out
def chip(ax, x, y, text, color=ACCENT, **kw):
"""Callout or delta as a rounded tinted chip. Place it centred on the mark it describes."""
kw.setdefault("ha", "center"); kw.setdefault("va", "center")
return ax.annotate(text, (x, y), fontsize=kw.pop("fontsize", 9.5), color=color, fontweight="semibold",
bbox=dict(boxstyle="round,pad=0.35,rounding_size=0.8", fc=TINT.get(color, "#EEF0F2"), ec="none"), **kw)
def end_dot(ax, x, y, color, size=46):
"""Line end (or slope point) marker with a white ring."""
ax.scatter([x], [y], s=size, color=color, edgecolor=CARD, linewidth=2, zorder=5, clip_on=False)
def contrast(a, b="#FFFFFF"):
"""WCAG contrast ratio of two hex colors (text needs >= 4.5, marks >= 3)."""
def lum(h):
c = [int(h[i:i + 2], 16) / 255 for i in (1, 3, 5)]
c = [v / 12.92 if v <= .03928 else ((v + .055) / 1.055) ** 2.4 for v in c]
return .2126 * c[0] + .7152 * c[1] + .0722 * c[2]
hi, lo = sorted([lum(a), lum(b)], reverse=True); return (hi + .05) / (lo + .05)
def clear_leader(values, i, margin=0.15): # rule 15: a 'best'/'worst' title needs a clear lead
s = sorted(values, reverse=True)
if values[i] != s[0]: return False
return len(s) < 2 or s[0] - s[1] >= abs(s[1]) * margin
def spread_labels(ys, min_gap):
"""Nudge label y-positions apart (keeping order). For EXACT ties, merge into one label instead."""
import numpy as np
ys = np.asarray(ys, float); out = ys.copy(); idx = np.argsort(ys)
for _ in range(50):
moved = False
for a, b in zip(idx[:-1], idx[1:]):
if out[b] - out[a] < min_gap:
d = (min_gap - (out[b] - out[a])) / 2; out[a] -= d; out[b] += d; moved = True
if not moved: break
return out
def claim(cond, msg): # check a title claim BEFORE drawing
if not cond: raise ValueError(f"Title claim is false: {msg}")
def end_label(ax, x, y, text, color): # direct label instead of legend
ax.annotate(text, (x, y), xytext=(6, 0), textcoords="offset points", va="center", color=color, fontweight="bold")
```
### Common moves
```python
# Shade the difference between two lines, colored by who leads
ax.fill_between(x, a, b, where=a>=b, color=ACCENT, alpha=.18, interpolate=True)
ax.fill_between(x, a, b, where=a<b, color=BLUE, alpha=.18, interpolate=True)
# Forecast: dashed line + confidence band + divider
ax.plot(xf, yf, ls="--", color=ACCENT); ax.fill_between(xf, lo, hi, color=ACCENT, alpha=.15)
ax.axvline(x_today, color=GREY, ls=":"); ax.axvspan(x_today, xf[-1], color="#000", alpha=.04)
# Explain a dip with a labeled band
ax.axvspan(t0, t1, color=ACCENT, alpha=.12); ax.text((t0+t1)/2, ax.get_ylim()[1], "Data outage", ha="center", va="top", color=ACCENT)
# Vs target: grey bars at true height; excess solid green, shortfall hatched/hollow red
for c, v in zip(cats, vals):
d = v - target
ax.bar(c, min(v, target), color=GREY)
if d > 0: ax.bar(c, d, bottom=target, color=GOOD)
else: ax.bar(c, -d, bottom=v, facecolor="none", edgecolor=ACCENT, hatch="///", lw=1)
ax.text(c, max(v, target)+1, f"{d:+}", ha="center", va="bottom", color=GOOD if d>0 else ACCENT, fontweight="bold")
ax.axhline(target, ls="--", color=DARK, lw=1)
ax.text(len(cats)-0.5, target, "Target", va="bottom", ha="right", color=DARK) # just above the line, right end
ax.set_xlim(-0.6, len(cats)-0.4)
# Highlight one series, grey the rest
for name, s in series.items():
hl = name == focus
ax.plot(s.index, s, color=ACCENT if hl else GREY, lw=2.5 if hl else 1, zorder=3 if hl else 1)
```
### Bracket for a group of bars (instead of a legend)
```python
def bracket(ax, x, bar_idx, text, color, tick=None): # spans the bars at these plotted positions (barh: bottom bar = 0)
tick = tick or (ax.get_xlim()[1] * 0.015)
y0, y1 = min(bar_idx) - .35, max(bar_idx) + .35
ax.plot([x, x+tick, x+tick, x], [y0, y0, y1, y1], color=color, lw=1.3, clip_on=False)
ax.text(x + tick*2.2, (y0+y1)/2, text, color=color, va="center", fontweight="bold")
# Derive bar_idx from the same list you colored, e.g. [i for i, c in enumerate(colors) if c == ACCENT].
# Never type the positions by hand; barh plots bottom-up, so hand-typed spans land on the wrong bars.
# Set xlim first (the tick size uses it), then widen it so the text fits.
```
(Don't use matplotlib's `-[` arrowstyle for this. It draws a horizontal bracket with a stem.)
### Auto-check before delivering (matplotlib)
```python
import itertools
from matplotlib.text import Text
def auto_check(fig, names=()):
"""Returns a list of rule breaks. Pass the series names that must be visible on screen."""
fig.canvas.draw(); issues = []
T = [(t, t.get_window_extent()) for t in fig.findobj(Text) if t.get_visible() and t.get_text().strip()]
T = [(t, b) for t, b in T if b.width > 1 and b.height > 1]
for (a, ba), (b, bb) in itertools.combinations(T, 2):
ticks = a.axes and a.axes is b.axes and {a, b} <= set(a.axes.get_xticklabels() + a.axes.get_yticklabels())
if not ticks and ba.padded(-2).overlaps(bb.padded(-2)):
issues.append(f"text overlap: {a.get_text()[:25]!r} x {b.get_text()[:25]!r}")
for ax in fig.axes:
if ax.get_legend() and len(ax.get_legend().get_texts()) < 5:
issues.append("legend used for <5 series: label lines and bars directly")
if ax.get_ylabel().strip(): issues.append("y-axis title: move the units into the subtitle")
if any(l.get_text() and l.get_rotation() % 360 for l in ax.get_xticklabels() + ax.get_yticklabels()):
issues.append("rotated tick labels")
yl = [l.get_text().strip() for l in ax.get_yticklabels() if l.get_visible()]
if yl and not any(yl) and any(g.get_visible() for g in ax.get_ygridlines()):
issues.append("y axis has gridlines but no numbers")
if not any(t.get_text().lower().startswith("source") for t, _ in T): issues.append("no source line")
shown = " ".join(t.get_text() for t, _ in T)
issues += [f"series not named on screen: {n!r}" for n in names if n not in shown]
return issues
```
---
## Using it in any tool or stack
Steps 0–4 are the skill, and they don't depend on any tool. The Python snippets above are one implementation. Every move in the catalog is built from the same five primitives, so translate those into whatever stack is in use:
| Primitive | What it is |
|---|---|
| **Reference line** | Target, pass mark, average, "today": a dashed line plus a short label at its end |
| **Shaded band/area** | Event window, forecast region, gap between two series, quadrant region (15–25% tint) |
| **Direct label** | Text next to the mark (line end, bar end, point), in the mark's color if readable or dark text with a colored marker, instead of a legend |
| **Highlight** | One series/bar/point in the accent color; everything else grey |
| **Text block** | Title (the finding) → subtitle (metric, units, period) → source footer |
| Stack | How to build the primitives |
|---|---|
| D3 / raw SVG | `line`/`rect`/`text` elements; you control every position, so apply the `spread_labels` logic to end labels |
| Chart.js | `chartjs-plugin-annotation` (line, box, label); `plugins.legend.display = false`; the `datalabels` plugin for direct labels |
| ECharts | `markLine`, `markArea`, series `label`/`endLabel`; `legend.show = false`. `symbol: 'none'` also hides data labels: to label one point use `symbol: 'circle'`, `showSymbol: true` and `symbolSize` 0 except at the labelled index |
| Recharts | `ReferenceLine`, `ReferenceArea`, `LabelList`; omit `<Legend/>` |
| Plotly | `shapes` (line/rect), `annotations`, `showlegend: false`, `yaxis.rangemode: "tozero"` for bars |
| Vega-Lite | layer `rule` and `rect` marks with `text` marks; `legend: null` |
| Excel / Google Sheets / PowerPoint | Extra series for target lines and bands; data labels "value from cells" for direct labels; delete the legend; the finding as chart title |
| SwiftUI Charts | `RuleMark`, `RectangleMark`, `.annotation(position:)` on marks; `.chartLegend(.hidden)` |
| Flutter / Jetpack Compose | Extra horizontal/vertical lines or range annotations in the chart library, or custom drawing for bands; text painters for direct labels |
| Figma / design mockups | Same rules as static charts. Use realistic numbers that pass the claim check, and label sample data as sample. |
### Extra rules for web and app interfaces
- **Small screens (under ~480px wide):** switch to horizontal bars, cut x ticks to 3–5, wrap the title to at most 2 lines, keep only the one annotation that carries the story, and move secondary detail behind a tap. KPI tiles go in a 2×2 grid, not one squeezed row.
- **Touch:** no hover-only information. The key value and the finding are always visible; tap reveals extra detail.
- **Dark mode:** re-derive the greys and the accent for the dark background rather than inverting them. Keep text contrast ≥ 4.5:1 and mark contrast ≥ 3:1 against the background.
- **Accessibility:** give the chart container `role="img"` and an `aria-label` with the title sentence, offer a data table fallback, and keep patterns or direct labels so color isn't the only cue.
- **Number formatting:** use the locale's formatter (`Intl.NumberFormat` or the platform equivalent). For Indian audiences, consider lakh/crore (₹4.8 Cr) instead of millions.
- **Motion:** no decorative animation. Use short transitions (≤ 300ms) only to show what changed between states.
- **Live and filtered dashboards:** mark partial periods and the last-updated time. Every piece of text that states a finding (the page headline, chart titles, recommended actions, notes) is recomputed and claim-checked on every filter change and data refresh, never written once for the default view. If a claim isn't true for the current state, switch to a neutral title, and drop any action the data no longer supports. Keep the axis scale fixed across filter states (Step 3).
### Auto-check before delivering (web pages, SVG or HTML charts)
Run it in the browser console or the page's test. It reads SVG and HTML text. For canvas-based charts (default Chart.js, ECharts in canvas mode), switch the renderer to SVG for the check, or review a screenshot by eye.
```js
function autoCheck(root = document, names = []) {
const els = [...root.querySelectorAll('svg text, [data-chart-text]')]
.filter(e => e.textContent.trim() && e.getBoundingClientRect().width > 1);
const r = els.map(e => e.getBoundingClientRect()), issues = [];
for (let i = 0; i < els.length; i++) for (let j = i + 1; j < els.length; j++) {
const a = r[i], b = r[j];
if (els[i].contains(els[j]) || els[j].contains(els[i])) continue;
if (a.left + 2 < b.right && b.left + 2 < a.right && a.top + 2 < b.bottom && b.top + 2 < a.bottom)
issues.push(`text overlap: "${els[i].textContent.trim().slice(0, 25)}" x "${els[j].textContent.trim().slice(0, 25)}"`);
}
if (root.querySelector('[class*="legend" i]')) issues.push('legend present: fine for 5+ series or a required design system; otherwise label lines and bars directly');
const leaf = [...root.querySelectorAll('*')].filter(e => !e.children.length);
if (!leaf.some(e => /^\s*source/i.test(e.textContent))) issues.push('no source line');
const shown = els.map(e => e.textContent).join(' ');
names.filter(n => !shown.includes(n)).forEach(n => issues.push(`series not named on screen: "${n}"`));
return issues;
}
```
Mark chart text that lives in HTML (KPI values, labels in divs) with `data-chart-text` so the check sees it.
- KPI tile markup: big number → delta line (▲/▼ + % + "vs last month", colored) → sparkline or bullet bar to target → tiny caption with the benchmark.
Community Reviews & Field Notes
Tried this skill on your own project? Share the model you used and the results you got.