activity 6 Task 2
✓ Published0🌍 Public
This example shows the distribution of employee salaries across six departments, broken into five income brackets from "below 50k" to "above 85k." A stacked bar chart displays each department’s proportional share per bracket, with a tooltip revealing the exact percentage on hover. The code uses d3.stack() to aggregate the data from a CSV file and d3.scaleBand and d3.scaleLinear for axes, with d3.axisLeft and d3.axisBottom for ticks. Custom colors, a legend, and interactive opacity changes on mouse events enhance readability.
AI-generated descriptionMIT Licensed