Question 2
This stacked bar chart visualizes the percentage of each rating level within different movie genres, showing how genre impacts IMDb ratings. Each genre has a horizontal bar divided into colored segments, with the total always summing to 100%. The chart uses D3.js v7's `d3.stack` and `d3.scaleOrdinal` to create the stacked layout, and `d3.axisBottom` and `d3.axisLeft` for the axes. Hovering over a segment triggers a tooltip displaying the exact percentage for that rating and genre, using D3's `.on('mouseover')` event handlers. The data comes from a CSV file with genre and rating percentages.
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%.