A hand-picked window, and the whole year
The shaded window is what a "rides collapsed 90%" headline would show. The full line shows one day, an app outage (14 August), and a normal day after it.
A chart can be built from correct numbers and still mislead: a cut axis on bars, two y axes, circles sized by radius, a hand-picked time window, totals instead of rates, uneven bins, a rainbow colour scale. Learn to spot each one, measure how much it lies, and fix it.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write lieFactor(shownA, shownB, trueA, trueB) that returns (shown effect ÷ true effect), using effect = (B − A) ÷ A. Return NaN when the true effect is zero. Check it with the June and July example: shown lengths 7,712 and 17,803, true 107,712 and 117,803.
A chart shows 12 months of rides with the y axis starting at 40,000. Is that honest for bars? For a line?
Explain it without notes
Why must a bar chart start at zero but a line chart need not?
What is a lie factor? Compute it for June and July with the axis cut at 100,000.
Why can a dual-axis chart mislead even if both axes are labelled?
What is wrong with a histogram whose bins have different widths and whose bar height is the count?
Preview
Console
Nothing logged yet.Expected console output
window 18 Jul to 14 Aug: 4380 -> 439 (-90%)
the next day, 15 Aug: 4138 (-6% vs 18 Jul)
average day of the year: 2558 | days below half of that: 22