Skip to main content
100%

Assignment_2.1_Student_Alcohol_Consumption

✓ Published0🌍 Public
VVishnu Mallampalli
Last edited Jul 12, 2024
Created on Jul 11, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes