🌍 Public
Viewing a saved revision (read-only)
9e96bc82a68b42f2b57ea516c84a1416
White Hat Pie Chart
This example creates a white-themed pie chart that displays a categorical dataset with labeled slices. The code uses D3.js v6 to build an SVG visualization, generating arcs with the `d3.pie` and `d3.arc` functions, and colors each slice using a `d3.scaleOrdinal` with `d3.schemeSet2`. Slice labels are positioned at arc centroids via `arcGenerator.centroid()`. The chart is rendered inside a React-friendly structure, with data defined as a simple object mapping group names to values.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.