Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Multiline chart

Public visualization

Multiline chart

0 stars12🌍 Public
Pprateekvasi
Last edited May 17, 2022
Created on Mar 3, 2022
Forked from Scatter plot

This example shows annual changes in forest area for six South American countries from 1990 to 2015 as a multiline chart, with each country as a colored line. The chart uses a time-scaled x-axis and a linear y-axis, with a legend mapping country names to colors. The code loads data from a CSV file using `d3.csv`, then applies `d3.scaleTime`, `d3.scaleLinear`, and `d3.line` to build the paths. Country lines are grouped via `d3.nest` and have interactive tooltips that appear on hover, with transitions handled through `.transition().duration(500)`. The rendering is SVG, with a static title and varying legend spacing.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed