Act6_q2
This stacked bar chart shows the percentage distribution of five rating levels across different movie genres, revealing how genre influences audience ratings. Each horizontal bar represents a genre, subdivided into colored segments corresponding to rating categories, with hover interactions displaying precise percentages via tooltips. The visualization uses D3 v7’s `d3.stack()` to compute stacked data, `d3.scaleBand()` for the categorical y-axis, and `d3.scaleLinear()` for the percentage x-axis. Data is loaded from a CSV file where ratings are pre-calculated as percentages summing to 1, rendered as SVG rect elements with ordinal color scaling.
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%.