task 2 question 2
✓ Published0🌍 Public
This example visualizes the percentage distribution of iris flower measurements (sepal length, sepal width, petal length, and petal width) across three species: setosa, versicolor, and virginica. It renders a stacked horizontal bar chart in SVG, with each bar representing a species and colored segments showing proportional contributions of each measurement type. The code uses d3.stack() to compute the stacked values, d3.scaleOrdinal() for color mapping, and d3.scaleLinear() and d3.scaleBand() for positioning. Interactive tooltips display precise percentage values on mouseover, with data loaded from the built-in Iris dataset.
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.
MIT Licensed