activity6_task2
A stacked bar chart displays the percentage of movie ratings across five genres, with each bar segmented by rating categories from below 5.0 to above 8.5. The chart uses d3.stack and d3.scaleOrdinal with a custom color palette to build the SVG visualization. Hovering over a segment triggers a tooltip showing the precise percentage for that rating level within the genre. The data originates from a CSV file loaded with d3.csv, and the axes use d3.axisLeft and d3.axisBottom with a linear scale for percentages and a band scale for genres.
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%.