act 6 q2
This example visualizes the percentage distribution of the Iris dataset across its three species (setosa, versicolor, and virginica) using a stacked horizontal bar chart. The chart displays the proportion of each measurement type—sepal length, sepal width, petal length, and petal width—per species, with each bar segmented by color and labeled along the x-axis. The visualization uses D3 v7’s `d3.stack`, `d3.scaleLinear`, `d3.scaleBand`, and `d3.axisBottom` to construct the plot. Interactive tooltips, styled via CSS, appear on mouseover to show the exact percentage for each segment. The data is loaded from a local `iris.csv` file.