BMI by Age
✓ Published0🌍 Public
This example visualizes the average Body Mass Index (BMI) by age, using binned age ranges along a linear scale. The chart displays blue bars for each age bin, with axes for age and average BMI, and a title labeling the graphic. The code loads data from a CSV file, computes BMI from weight and height, and uses D3 v7 APIs including `d3.bin`, `d3.scaleLinear`, `d3.axisBottom`, and `d3.axisLeft` to render the SVG. Axes are styled with custom tick marks and labels, while the binning groups individual data points into age intervals.
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