🌍 Public
Viewing a saved revision (read-only)
475d19f49d094e96aed0b517e8d30b34
Question1
This visualization is a donut-style pie chart that displays the distribution of five age groups (0-17, 18-34, 35-49, 50-64, and 65+) by their respective counts. The chart uses a categorical color scale from `d3.scaleOrdinal` with `d3.schemeCategory10` to differentiate each segment. The pie layout is computed using the `d3.pie` and `d3.arc` APIs, with the arcs rendered as SVG paths inside a 400x400 pixel container. A custom HTML legend, styled with flexbox, lists each age group alongside a color swatch and its count. The data is defined locally in a JavaScript array and rendered via the `d3.select` API.
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.