Skip to main content
100%

Activity 6 task 5

✓ Published0🌍 Public
Lleftymadi
Last edited Jun 14, 2023
Created on Jun 14, 2023
Forked from Hello VizHub

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 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