Fork of Activiy6_question2
This stacked bar chart visualizes how movie genres relate to rating distributions, showing the proportion of each rating category within genres like Pop, Rock, and Jazz. The horizontal bars represent genres, with segments colored by rating level and a tooltip displaying exact percentages on hover. Built with D3 v7, the code uses `d3.stack()` to compute the stacked segments, `d3.scaleBand` for the genre axis, and `d3.scaleLinear` for the percentage scale. Data comes from a static CSV file, and SVG rendering handles the visualization with an interactive tooltip appended to the body.
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%.