ry0214_Question 1
✓ Published0🌍 Public
This pie chart visualizes the species distribution in the Iris dataset, displaying the proportional counts of setosa, versicolor, and virginica flowers. The D3.js v7 code counts occurrences from an embedded array and renders the chart as an SVG using `d3.pie()` for arc generation and `d3.arc()` for path construction. A categorical color scale (`d3.scaleOrdinal`) assigns distinct hues to each species, with white labels positioned at arc centroids. A horizontal HTML legend below the chart matches colored squares to species names. The dataset contains 150 sample records, though only a subset is listed in the provided code stub.
AI-generated descriptionMIT Licensed