Multiline chart
✓ Published12🌍 Public
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 descriptionMIT Licensed