que 2 supriya
This example visualizes the distribution of the Iris dataset by species and sepal/petal measurements. It displays a horizontal stacked bar chart where each species of iris is represented as a single bar, broken into colored segments corresponding to sepal length, sepal width, petal length, and petal width, scaled as percentages. The visualization uses D3.js v7 loaded from UNPKG, with `d3.stack` to create the stacked data, `d3.scaleBand` for the categorical y-axis, `d3.scaleLinear` for the percentage x-axis, and `d3.axisBottom` for the axis ticks. Hovering over a segment triggers a tooltip that displays the exact percentage for that species and measurement. The data comes from the classic `iris.csv` file.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.