Skip to main content
100%

Melting Data for Multiple Lines

✓ Published1🌍 Public
MMatthew Rubino
Last edited Jun 18, 2021
Created on Jun 18, 2021

This example visualizes population trends for multiple countries over time as a series of colored lines, using a legend to identify each country. The chart displays time on the x-axis and population on the y-axis, with a title and axis labels. The code uses `d3.csv` to load data from a UN population estimates dataset, which is then "melted" from wide to long format to create individual line paths. It leverages D3 v6 APIs including `scaleTime`, `scaleLinear`, `scaleOrdinal`, `line`, `curveBasis`, `axisLeft`, `axisBottom`, and `group`, rendering the final visualization as an SVG.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes