🌍 Public
Viewing a saved revision (read-only)
34898e7307fb427a87cdebaacfda76f1
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.