Activity8_Task2
This stacked bar chart visualizes the distribution of IMDb ratings across six movie genres, showing the percentage of films falling into five rating brackets. Each genre is represented by a horizontal bar segmented by rating category, with a legend identifying the color-coded brackets. The visualization uses d3.csv to load data from a CSV file and d3.stack to compute the stacked segments. Interactive tooltips appear on mouseover, displaying the exact percentage for each rating segment using d3’s format function. The chart is rendered as SVG with axes created via d3.axisBottom and d3.axisLeft, using ordinal and linear scales for positioning.
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%.