🌍 Public
Viewing a saved revision (read-only)
37983e64dd0c4b81854d7c0b65b3bfaa
Activity 7 Q1
This example shows a pie chart that visualizes categorical data loaded from a remote CSV file, with each slice colored using a categorical color scale and a legend pairing colors with category and subcategory labels. The chart is rendered as SVG using D3.js v6, where the `d3.pie()` generator computes slice angles and `d3.arc()` creates the path shapes. Data is fetched via `d3.csv`, and the color mapping uses `d3.scaleOrdinal` with `d3.schemeCategory10`. The code also adds axis labels (X and Y) that are not tied to the pie chart, acting as placeholders within the SVG layout.
AI-generated descriptionA demonstration of how to start using D3 version 6.