activity 6 task2
This stacked bar chart shows the distribution of ratings across six sports, with each bar segmented into five rating levels from “below 5.0” to “above 8.5.” The visualization uses D3.js v7 to create a horizontally stacked bar chart, where the x-axis represents the percentage (scaled from 0 to 1) and the y-axis lists the sports. Interactive tooltips display the exact percentage for each segment on mouseover, formatted to two decimal places. The chart uses `d3.scaleOrdinal` for color assignment, `d3.scaleLinear` for the x-axis, and `d3.scaleBand` for the y-axis, rendering with SVG and styled via CSS.
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%.