Skip to main content
100%

Pie chart

✓ Published0🌍 Public
VVineela Reddy
Last edited Apr 25, 2024
Created on Apr 25, 2024

This pie chart visualizes shipping amounts across different cities during the Covid era, with each slice labeled by its value and a legend identifying city names. The code fetches CSV data from a GitHub gist using `d3.csv` and renders the chart with React and SVG. It employs `d3.pie` to compute arc segments, `d3.arc` to generate path geometries, and `d3.scaleOrdinal` for color mapping. Text labels are positioned via `arc.centroid`, and a custom legend displays colored rectangles and city names.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes