Line Chart with Multiple Lines Matching The legend
✓ Published1🌍 Public
This example shows a week of temperature readings from multiple cities as smooth, overlapping line paths, with a color legend matching each line to its city. The chart uses D3 v6 with `scaleTime`, `scaleLinear`, and `scaleOrdinal`, and nests the CSV data by city via `d3.nest`. Lines are generated with `d3.line` and `curveBasis`, while a custom `colorLegend` component renders the legend with SVG circles and text.
AI-generated descriptionThis dataset can also be found at https://vizhub.com/curran/datasets/temperature-in-san-francisco.csv
Video: https://www.youtube.com/watch?v=xFI-us1moj0 Color legend: https://youtu.be/_8V5o2UHG0E?t=29117
MIT Licensed