Melting Data for Multiple Line Chart
✓ Published0🌍 Public
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 descriptionMIT Licensed