Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity-6 Task-3

Public visualization

Activity-6 Task-3

0 stars0🌍 Public
Aarthireddykota@my.unt.edu
Last edited Apr 4, 2024
Created on Apr 4, 2024

This example visualizes the distribution of vegetable pH ratings across five categories, from below 5.0 to above 8.5, using a horizontal stacked bar chart. Each bar represents a vegetable, with segments colored by pH range and a tooltip showing the exact percentage on hover. The code loads D3 v7 via UNPKG, uses `d3.stack()` to compute stacked series, `d3.scaleOrdinal` for color mapping, and `d3.axisBottom` with gridlines for the percentage axis. Data comes from the included `data.csv` file, and the SVG rendering is driven by D3’s data-join pattern.

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.

Comments

Sign in to join the discussion.

MIT Licensed