Activity 6_Task 2
A stacked bar chart displays the percentage distribution of IMDb rating levels across six movie genres, showing how genres like Documentary skew toward higher ratings while Action clusters at lower ones. Built with D3 v7, the chart uses a linear x-scale for percentages, a band y-scale for genres, and an ordinal color scale for rating categories. Hover interactions trigger tooltips with exact percentages via D3 event handlers, while SVG rectangles render the stacked data from a CSV file loaded with `d3.csv`.
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%.