Task8_Tutorial 2_Q
This stacked bar chart visualizes the percentage of revenue across six product categories, with each bar segmented into five revenue ranges from "less than 100" to "above 5000." The data comes from a CSV file, and the visualization uses d3.stack() to compute the stacked segments, with a d3.scaleOrdinal providing color encoding for each revenue range. Hovering over any segment triggers a tooltip that displays the exact percentage for that category and revenue range. The chart employs d3.scaleLinear for the x-axis, d3.scaleBand for the y-axis categories, and SVG rect elements for rendering the bars.
AI-generated descriptionThe impact of revenue of different categories
This stacked bar chart gives the percentage of each revenue of different categories. The aim is to show the revenue of different categories in a stacked bar visual. When the mouse hovers over each bar, you can see pop-ups of accurate percentage of each revenue percentage of different categories. Total percentage is 1, representing 100%.