Line Chart Using a Qualitative Color Scale with D3
This line chart tracks abortion rates over time across multiple U.S. states, with each state represented by a separate colored line using a qualitative Set1 color scale from ColorBrewer. A legend to the right identifies each state, and hovering over individual data points reveals an interactive tooltip with the year, state, and rate. The visualization is built with D3 v7, using `d3.scaleOrdinal` for color assignment, `d3.line` for path generation, and SVG rendering with animated tooltip transitions.
AI-generated descriptionAssignment 6 part A+
Line chart with at least 4 separate lines colored using a qualitative color scale with the appropriate legend.
I've generated and used this color schema: https://colorbrewer2.org/?type=qualitative&scheme=Set1&n=8 but later I've got that I can load colors directly fromt the https://colorbrewer2.org/export/colorbrewer.js and use in the code.
Provided example refers to the v3 of D3 and some of the methods mentioned are deprecated, e.g. scale.category10. Also http should be changed to https in order colorbrew to work.
documentation https://github.com/d3/d3/blob/main/API.md