Components/Line chart

Line chart

Lines over 3, 6 or 12 months with a crosshair, one tooltip for every series and arrow-key reading.

Overview

A line chart for anything over time, hand-built in SVG. One series gets a soft area underneath; two to four get a legend. A crosshair snaps to the nearest month and one tooltip lists every series there.

What it does

  • Switch between the last 3, 6 or 12 months
  • Read every series at a month from one tooltip, on hover or with the arrow keys
  • Fill whatever size its card is, with axis labels that never collide
  • Draw in on load, or appear at once when reduced motion is on
  • Read it with a screen reader through a hidden table

Try it

  1. 1Move along the chart to read each month
  2. 2Switch to 3M and back to 12M
  3. 3Tab to the chart and use the left and right arrow keys

Everything works in the live preview above.

Used in