Tutorial 2
This chart shows how movie ratings are distributed across genres, with each genre represented as a horizontal stacked bar divided into five rating categories. The chart uses D3.js v7 with an SVG renderer. The data, loaded from a local CSV file, is transformed with `d3.stack()` and mapped to colors with `d3.scaleOrdinal()`. Hovering over a segment displays a tooltip with the precise percentage for that genre-rating combination, calculated from the values formatted with `d3.format(".2f")`.
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%.