Activity 6_Task-2_Question_2
✓ Published0🌍 Public
This example visualizes the distribution of viewership ratings across five sports, using a horizontal stacked bar chart where each bar segment represents the proportion of viewers in a rating category (e.g., "Below 5.0", "5.0-6.5"). The chart, rendered with D3.js v7, employs a band scale for the y-axis and a linear scale for the x-axis. The code builds the stacked bars using `d3.stack` and `d3.scaleOrdinal` for color mapping, with interactive tooltips showing exact percentages on hover. Data is loaded from a static CSV file.
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.
MIT Licensed