Fork Activity6_Question2
This stacked bar chart visualizes the distribution of IMDb ratings across six categories, illustrating how category influences ratings. Each horizontal bar segments proportions of ratings into five bands, from “below 5.0” to “above 8.5,” with segment lengths scaled by the percentage of ratings in each band. Hovering over a segment highlights it and displays a tooltip showing the exact percentage for that rating band within the category. The chart uses D3.js v7 with the `d3.stack` API to construct the stacked bars, `d3.scaleOrdinal` for color coding, `d3.scaleBand` for the categorical y-axis, and `d3.axisLeft`/`d3.axisBottom` for axes, all rendered as an SVG from the provided CSV data.
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%