0100200300400JanFebMarAprMayJunSightings, Jan: 120Sightings, Feb: 180Sightings, Mar: 150Sightings, Apr: 240Sightings, May: 310Sightings, Jun: 280Recruits, Jan: 30Recruits, Feb: 45Recruits, Mar: 40Recruits, Apr: 80Recruits, May: 95Recruits, Jun: 90
  • Sightings
  • Recruits

Add smooth for curves instead of straight segments. The curve still passes through every point and never overshoots it, so a smooth line cannot dip below the data or past the axis.

0100200300400JanFebMarAprMayJunSightings, Jan: 120Sightings, Feb: 180Sightings, Mar: 150Sightings, Apr: 240Sightings, May: 310Sightings, Jun: 280Recruits, Jan: 30Recruits, Feb: 45Recruits, Mar: 40Recruits, Apr: 80Recruits, May: 95Recruits, Jun: 90
  • Sightings
  • Recruits

When the data changes, the lines glide to their new positions instead of redrawing (pass animate={false} for an instant update).

050100MonTueWedThuFriSatSungiggles, Mon: 65giggles, Tue: 76giggles, Wed: 90giggles, Thu: 62giggles, Fri: 70giggles, Sat: 88giggles, Sun: 79

Props

  • labelsstring[]

    Names of the x positions / categories.

  • series{ name, values: number[], color? }[]

    One entry per series; values has one number per label.

  • heightnumber
    Default: 300

    Chart height in px (width follows the container).

  • labelstring

    Accessible name for the chart.

  • legendboolean
    Default: true

    Show the legend when there are several series.

  • areaboolean
    Default: false

    Fill under each line.

  • smoothboolean
    Default: false

    Draw curves instead of straight segments. They pass through every point and never overshoot it.

  • animateboolean
    Default: true

    Animate the chart in when it appears and glide it to new values when the data changes (skipped for users who prefer reduced motion).

  • classNamestring
    Default: ''

    Extra classes for the root element.