Tutorial 8 Task 2
✓ Published0🌍 Public
A stacked horizontal bar chart displays the percentage distribution of IMDb movie ratings across six genres, with each bar segmented into five rating brackets from “below 5.0” to “above 8.5.” The chart uses D3 v7’s `d3.stack()` to compute the stacked series and `d3.scaleOrdinal` for color mapping, rendering SVG rectangles via data joins. Axis labels and tick formatting are handled with `d3.axisBottom` and `d3.axisLeft`, while hover interactions show a custom tooltip with precise percentages. The data originates from a CSV file loaded and parsed by D3.
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