🌍 Public
Viewing a saved revision (read-only)
5d7f1aa28e574739b93783f2b4db02a5
Task8_Q2)
This example shows a stacked bar chart of cricket scores by country, with individual bars colored by player name and an interactive tooltip revealing each player's score on hover. Built with D3.js v7, it renders an SVG visualization using `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and `d3.scaleOrdinal` with `d3.schemeCategory10` for colors. Data is loaded asynchronously from a CSV file via `d3.csv`, and a custom tooltip is implemented using D3's selection and transition methods. A legend is generated dynamically using `color.domain()` and appended as HTML to the page body.
AI-generated description