piechart
✓ Published0🌍 Public
This pie chart visualizes categorical data loaded from a CSV file, displaying each category as a colored slice with a label and a legend. The code uses D3 v6 API functions including `d3.pie` to compute arc data, `d3.arc` for path generation, and `d3.scaleOrdinal` with `d3.schemeCategory10` for color mapping. It renders as an SVG with a centered group, positioning arc paths and text labels via the `arc.centroid` method, while the legend is built with appended rectangles and text elements.
AI-generated descriptionMIT Licensed