Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

ry0214_Question 1

Public visualization

Viewing a saved revision (read-only)

055d9d6794ef454fa8df940305c33498

ry0214_Question 1

0 stars0🌍 Public
Rreddyyeddula16@gmail.com
Last edited Mar 22, 2025
Created on Mar 22, 2025
Forked from Hello VizHub

This pie chart visualizes the species distribution in the Iris dataset, displaying the proportional counts of setosa, versicolor, and virginica flowers. The D3.js v7 code counts occurrences from an embedded array and renders the chart as an SVG using `d3.pie()` for arc generation and `d3.arc()` for path construction. A categorical color scale (`d3.scaleOrdinal`) assigns distinct hues to each species, with white labels positioned at arc centroids. A horizontal HTML legend below the chart matches colored squares to species names. The dataset contains 150 sample records, though only a subset is listed in the provided code stub.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG (pinned at v6, since this runtime environment only supports UMD, and in v7 D3 dropped UMD support)
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.