🌍 Public
Viewing a saved revision (read-only)
c296415ff8354d92a46164498e3aba4e
Question 2
This example shows fruit sales across three regions as a horizontal stacked bar chart, with each bar segmented by region and color-coded via a legend. It loads data from a CSV file using d3.csv, parses numeric values, and builds the visualization with d3.stack, d3.scaleBand for the categorical y-axis, and d3.scaleLinear for the quantitative x-axis. The SVG rendering uses d3.axisLeft and d3.axisBottom for axes, while d3.scaleOrdinal assigns distinct colors to each region.
AI-generated description