Assignment_2.1_Student_Alcohol_Consumption
✓ Published0🌍 Public
A pie chart displays the distribution of student alcohol consumption by age, with each slice representing the count of entries for a specific age group. Built using D3 v7, the visualization loads data from a CSV file, aggregates counts with `d3.rollup`, and generates arcs with the `d3.pie` and `d3.arc` helpers. A legend with color-coded rectangles maps the ordinal color scale to age values, while labels placed at arc centroids identify each slice. The chart is rendered as an SVG element.
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.
MIT Licensed