Skip to main content
100%

task 2 question 2

✓ Published0🌍 Public
Rraaghaveramireddy@my.unt.edu
Last edited Oct 23, 2024
Created on Oct 23, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes