Activity6_Task2
A stacked bar chart visualizes the percentage distribution of IMDb rating categories across six movie genres, showing how genres such as Documentary and Action differ in rating outcomes. Each bar segment represents a rating level, with hover interactions displaying exact percentages via a tooltip. The visualization uses D3 v7’s `d3.stack`, `scaleBand`, and `scaleLinear` APIs to generate SVG rectangles in a stacked layout, with data loaded from a CSV file. A color scale encodes the rating categories, and axes are rendered using `d3.axisBottom` and `d3.axisLeft`.
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%.