Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

ah-Pie chart

Public visualization

Viewing a saved revision (read-only)

c5c228147141486ab339551d3ff0cd80

ah-Pie chart

0 stars0🌍 Public
VVineela Reddy
Last edited Apr 24, 2024
Created on Apr 24, 2024
Forked from Fork of Pie chart

This example visualizes the distribution of survey respondents across different age groups as an interactive pie chart, with each slice labeled with its corresponding value and accompanied by a color-coded legend. The chart uses D3.js v5 within a React framework, employing the `pie()` and `arc()` functions to compute the arc paths and the `scaleOrdinal()` for color mapping. Data is fetched asynchronously from a CSV file using `d3.csv`, and the SVG rendering includes custom text placement via `arcGenerator.centroid()` for labels.

AI-generated description

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

See also React Starter.