Skip to main content
100%

Stacked-bar with own data

✓ Published0🌍 Public
GGabriel Ing
Last edited Jan 30, 2025
Created on Jan 30, 2025

A stacked bar chart visualizes the total distance of physical activities per year, with bars segmented by sport type (Run, Ride, Walk, and Hike combined). The chart uses an SVG rendering pipeline with D3 v7’s `d3.csv` for data loading, `d3.group` and `reduce` for aggregation, and `d3.stack` to compute stack offsets. Axes are generated with `d3.axisBottom` and `d3.axisLeft`, while a categorical `d3.scaleOrdinal` assigns colors to the four activity categories. The data originates from a personal fitness tracking CSV, with distances converted from meters to kilometers.

AI-generated description

example copied from d3-graph-gallery

MIT Licensed

Similar vizzes