Fork of Activity6_questions 3 45
A stacked bar chart visualizes product sales across four categories, with each bar segment representing a category’s contribution to total sales for a given product. The chart encodes values on a linear x-axis and product names on a categorical y-axis, using color to distinguish categories. Built with D3 v7, it uses `d3.stack()` to compute stacked values, `d3.scaleBand()` for the y-axis, and `d3.scaleLinear()` for the x-axis. Data is loaded via `d3.csv()` from a local CSV file, and SVG rectangles render each segment with mouseover logging to the console.
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%.