Activity6_Task2
This stacked bar chart illustrates how the percentage of IMDb ratings varies across six movie genres, such as Documentary and Action, with each bar segmented into five rating brackets from “below 5.0” to “above 8.5.” Built with D3 v7, the visualization uses `d3.stack` to compute the stacked series and `d3.scaleOrdinal` for categorical coloring. Hovering over a segment triggers a custom tooltip that displays the exact percentage for that rating level within the genre, updating via mouse event handlers. The chart relies on SVG rendering and uses `d3.axisBottom` and `d3.scaleBand` for the percentage and genre axes respectively.
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%.