D3 grouped line chart: Daily temperature in Belgium between 2017 and 2021
✓ Published0🌍 Public
Rrvdv
Last edited Jan 9, 2022
Created on Jan 9, 2022
This example visualizes daily average air temperatures in Belgium from 2017 to 2021, with each year represented as a separate line. The data is loaded from a CSV file using d3.csv, then grouped by year with d3.nest. The chart uses React for rendering SVG elements, with scales from d3.scaleTime and d3.scaleLinear mapping dates and temperatures. Lines are drawn using d3.line with a curveBasis interpolation, and colors are assigned via d3.scaleOrdinal with schemeCategory10. A color legend is generated using a custom d3 selection-based function.
AI-generated descriptionFollowing along with Curran at https://www.youtube.com/watch?v=2LhoCfjm8R4&t=22532s
Grouping logic from https://vizhub.com/curran/2546209d161e4294802c4ac0098bebc2?edit=files&file=index.js
MIT Licensed