🌍 Public
Viewing a saved revision (read-only)
cc05528887b343b0960c19ed3e45db8c
Assignment2Question2
This D3.js v7 example creates an SVG area chart that visualizes monthly sales data for two products during 2022. The chart displays values from the embedded data array, with product1 and product2 each shown as filled areas using `d3.area()` and a categorical color scale via `d3.scaleOrdinal` with `d3.schemeCategory10`. A legend is generated using D3’s selection API to map colors to product names, while axes are created with `d3.axisBottom` and `d3.axisLeft`, and data is scaled using `d3.scaleBand` and `d3.scaleLinear`.
AI-generated description