Skip to main content
100%

Pie Chart Visualization

✓ Published0🌍 Public
JJames Cruz
Last edited Apr 26, 2024
Created on Apr 26, 2024
Forked from HTML Starter

This pie chart visualizes the distribution of accident severity categories—Fatal (20), Serious (50), and Slight (30)—using a simple three-slice SVG. The code uses d3.pie() to compute arc angles from the data, d3.arc() to generate path geometries, and d3.schemeCategory10 for slice colors. Labels are placed using arc.centroid, with each slice having a clickable cursor style. The chart renders in a React-friendly static HTML page with D3 v7 loaded directly from the CDN.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes