Activity 6 task 5
✓ Published0🌍 Public
This example visualizes the relationship between age and average body mass index (BMI) using binned bar charts. It loads CDC survey data from a CSV file, calculates BMI from height and weight, and groups ages into bins before aggregating the mean BMI per bin. The visualization uses D3 v7’s `scaleLinear`, `axisBottom`, `axisLeft`, and `bin` APIs to construct axes and histogram bars in an SVG canvas. Styling is applied via CSS classes, with orange rectangles representing the binned averages.
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