Fork of Activity-6 Question2
This stacked bar chart shows how movie ratings vary across genres, with each bar divided into rating categories and the total always equaling 100%. Hovering over a bar segment reveals a tooltip with the exact percentage for that rating within the selected genre. The visualization uses D3 v7’s `d3.stack`, `d3.scaleOrdinal`, `d3.scaleLinear`, and `d3.scaleBand` to generate SVG rects, with `d3.axisBottom` and `d3.axisLeft` for axes. A custom tooltip displays precise values, while the color palette distinguishes rating levels.
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%.