Viewing a saved revision (read-only)
629c630117b64f4fa4eb9dc2cd6e7330
Activity 6 question 2
This visualization displays the percentage breakdown of four iris flower measurements (sepal length, sepal width, petal length, petal width) for each of the three iris species. Built with D3 v7, it uses a horizontal stacked bar chart where each bar represents a species, and colored segments show the proportional contribution of each measurement. The code employs `d3.stack` to compute the stacked data, `d3.scaleLinear` for the percentage axis, and `d3.scaleBand` for the categorical species axis. Interactive tooltips reveal exact percentage values on hover, while the SVG rendering uses `d3.select` and `d3.append` to construct the chart and handles.
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.