Activity6_Task2 que2
This stacked bar chart visualizes the impact of movie genres on IMDb ratings, showing the proportional distribution of five rating levels within each genre. The horizontal bars, rendered as SVG rectangles, display percentages that sum to 100% per genre. Hovering over any segment reveals a tooltip with the exact percentage for that rating level. The visualization uses D3 v7’s `d3.stack()` for data stacking, `d3.scaleBand()` for genre positioning, and `d3.scaleOrdinal()` with a custom color palette. Mouse events (`mouseover`, `mousemove`, `mouseout`) trigger the interactive tooltip, while axes are generated with `d3.axisLeft()` and `d3.axisBottom()`.
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%.