Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Melting Data for Multiple Line Chart

Public visualization

Melting Data for Multiple Line Chart

0 stars0🌍 Public
Nnkohdatavis
Last edited Aug 1, 2020
Created on Aug 1, 2020

This visualization displays a week of temperature readings for multiple cities using a multi-line chart. The code reshapes the UN Population Estimates data into a tidy format via `d3.nest()` to group measurements by city, then renders smooth paths with `d3.line()` and `curveBasis`. Axes are generated with `axisBottom` and `axisLeft`, while a custom `colorLegend` function uses `scaleOrdinal` and `schemeCategory10` to assign city colors. Data loads from a CSV file via `d3.csv`, and the chart includes a title, labeled axes, and a legend positioned at the right margin.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed