BMI by Age
✓ Published0🌍 Public
This bar chart displays the average body mass index (BMI) across different ages from a CSV dataset, with age on the x-axis and average BMI on the y-axis. The code uses d3.csv to load data, d3.bin to group ages into bins, and d3.scaleLinear, d3.axisBottom, and d3.axisLeft to render the axes. The chart is drawn as SVG rectangles with a light blue fill, and the BMI is calculated from weight and height fields using the formula (weight/height²)*703.
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