Skip to main content
100%

act 6 q2

✓ Published0🌍 Public
Ppavithranamburi24@gmail.com
Last edited Oct 22, 2024
Created on Oct 22, 2024
Forked from act 6 t2

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.

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