D3 Line Chart with Multiple Lines
✓ Published3🌍 Public
This visualization shows temperature trends across multiple cities over a one-week period, using a multi-line chart with a categorical color scheme and a custom color legend. D3’s `scaleTime` and `scaleLinear` map timestamps and temperature values to SVG coordinates, while `line()` with `curveBasis` creates smooth paths for each city. The code uses `nest()` to group data by city, `scaleOrdinal` with `schemeCategory10` for colors, and `axisBottom`/`axisLeft` for axes with gridlines. Data loads from a CSV file via `d3.csv`, and a custom `colorLegend` component renders the legend.
AI-generated descriptionMIT Licensed