Stacked Bar Chart - Attrition Level per Categories
A stacked bar chart displays customer attrition percentages across five categorical variables—income level, education level, marital status, card category, and gender—from the Bank Customers Dataset. A dropdown menu lets users switch between these categories, while bar segments encode existing versus attrited customers. Hovering over legend items highlights corresponding segments, and hovering over individual rectangles reveals exact percentage values via tooltips. The visualization is built with D3 v7, using `d3.stack` with `stackOffsetExpand`, `d3.scaleBand`, `d3.rollups` for data aggregation, and SVG rendering with animated transitions.