Skip to main content
100%

que 2 supriya

✓ Published0🌍 Public
SSupriya Ravilla
Last edited Apr 8, 2024
Created on Apr 8, 2024
Forked from Hello VizHub

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 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