Task 8 tutorial 2.1
A stacked bar chart visualizes the distribution of IMDb ratings across movie genres, with each bar divided into five rating brackets from below 5.0 to above 8.5. The chart emphasizes the share of each rating level within genres, allowing comparison of rating patterns. Built with D3 v7, the code uses `d3.stack()` for data stacking, `d3.scaleBand()` for the categorical y-axis, and `d3.scaleLinear()` for the percentage x-axis. Interactive tooltips display exact hovered segment percentages, implemented via mouse event handlers and an HTML overlay styled with CSS.
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%.