🌍 Public
Viewing a saved revision (read-only)
1f7e421bf2924836845ea5a72202bf3e
Activity 6_Task 2
This example visualizes the distribution of IMDb movie ratings across six genres, showing the percentage of titles in each rating bracket from below 5.0 to above 8.5. It uses a stacked horizontal bar chart rendered with D3 v7 and SVG, where each genre is a bar and each segment represents a rating range. The code employs `d3.stack()` to compute the stacked series, `d3.scaleOrdinal` for color encoding, and `d3.scaleBand` for the categorical axis. Interactive tooltips display the exact percentage for each segment on hover.
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.