Activity 6 task 2
This example displays a stacked bar chart showing the percentage distribution of IMDb rating categories across six movie genres. The chart reveals that documentaries and dramas have higher shares of strong ratings, while action and comedy films skew toward lower rating brackets. Built with D3.js (v7) and rendered as SVG, the visualization uses `d3.stack()`, `d3.scaleOrdinal()`, and `d3.axisBottom()` to compose the bars. Hovering over a segment triggers an HTML tooltip showing the precise percentage for that genre-rating pair, formatted with `d3.format()`. The data comes from a CSV file with pre-aggregated proportions per genre.
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%.