🌍 Public
Viewing a saved revision (read-only)
418177b2ef644be3889bb45760b8c85d
Firoze_sd_q1
This example uses a pie chart to display the number of students graduating from different fields at IIT Mumbai. The data is fetched via the `csv` function from D3 v5 and rendered as SVG paths using the `pie` and `arc` generators, with a `scaleOrdinal` mapping categorical colors to each segment. D3’s `arc().centroid()` positions text labels showing values in thousands, and a legend built with SVG `rect` and `text` elements lists the majors alongside their totals. The chart is centered with a fixed viewport, and styling is applied through CSS classes.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.