Activity6_Que2
This stacked bar chart shows the percentage distribution of five IMDb rating levels (below 5.0 to above 8.5) across six product categories, illustrating how category influences ratings. Each horizontal bar represents one category, with colored segments for each rating range. Hovering over a segment displays an exact percentage via a tooltip implemented with D3 event handlers. The visualization uses d3.stack() to generate stacked data, d3.scaleOrdinal for colors, d3.scaleLinear for percentages, and d3.scaleBand for categories, rendering as SVG with axes from d3.axisBottom and d3.axisLeft.
AI-generated descriptionThe impact of category on ratings
This stacked bar chart gives the percentage of each rating level within different categories. The aim is to show the impact of category on ratings. When the mouse hovers over each bar, you can see pop-ups of accurate percentages of each rating level within each category. The total percentage is 1, representing 100%