Activity-6 task 2
This stacked bar chart visualizes the impact of movie genre on IMDb ratings, displaying the percentage of each rating level (from below 5.0 to above 8.5) within six genres, with totals summing to 100%. The chart uses d3.stack() to create stacked segments, d3.scaleBand() for the genre categories on the y-axis, and d3.scaleLinear() for the percentage scale on the x-axis. Interactive tooltips, implemented with D3 event handlers and HTML div elements, show precise percentages on hover, while a color scale distinguishes the five rating categories across the SVG-rendered bars.
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%.