Activity6_Task2
This stacked bar chart from D3 v7 visualizes the distribution of IMDb ratings across six movie genres, using d3.stack and d3.scaleOrdinal for color encoding. Each horizontal bar represents a genre, segmented into five rating categories from “below 5.0” to “above 8.5,” with segment lengths proportional to the percentage of films in that rating band. The chart employs d3.axisBottom for the percentage scale and d3.scaleBand for the categorical genre axis. Hovering over a segment triggers an HTML tooltip via mouseover events, displaying the exact percentage for that rating level within the selected genre, with all values summing to 100%. The data comes from a local CSV file.
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%.