Skip to main content
100%

Multiple lines

✓ Published0🌍 Public
RRoger Yu-Hsiang Lo
Last edited Feb 14, 2020
Created on Feb 14, 2020

This example visualizes a week of temperature readings from multiple cities using multiple colored lines, with a legend identifying each city. The chart uses D3 v5 with SVG rendering, employing `scaleTime` and `scaleLinear` for axes, `nest()` to group data by city, and `line()` with `curveBasis` for smooth paths. A categorical color scale assigns distinct strokes, and a custom `colorLegend` function renders the legend. Data is loaded from a CSV file via `d3.csv`, with axes from `axisBottom` and `axisLeft`.

AI-generated description
MIT Licensed

Similar vizzes