Skip to main content
Public

Share visualization

Loading preview…

Multiline chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Multiline chart

11
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