Activity6_Task2
This visualization shows how movie ratings are distributed across six genres, with each genre’s stacked horizontal bar representing the percentage of films falling into five rating bands (below 5.0, 5.0–6.5, 6.5–7.5, 7.5–8.5, above 8.5), summing to 100%. The chart uses D3.js v7’s `d3.stack` to build the stacked bars, `d3.scaleOrdinal` for color mapping, and `d3.axisBottom`/`d3.axisLeft` for axes. Hovering over any segment triggers a tooltip that reveals the exact percentage for that rating band within the genre, using D3’s event handlers on SVG rectangles.
AI-generated descriptionThe impact of genre on movie ratings
This stacked bar chart gives the percentage of each rating level within different movie genres. The aim is to show the impact of genre on movie ratings. When the mouse hovers over each bar, you can see pop-ups of accurate percentage of each rating level within each genre. Total percentage is 1, representing 100%.