Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

activity6question-1

Public visualization

Viewing a saved revision (read-only)

1a6da13b7fb043fb8c126d75243d5b34

activity6question-1

0 stars0🌍 Public
Vvaishnavi6gan@gmail.com
Last edited Apr 3, 2024
Created on Apr 3, 2024
Forked from Hello VizHub

This example shows a horizontal bar chart comparing the populations of ten countries from the year 2000, with a green bar representing each country’s population in millions. The visualization uses React to render SVG elements, with D3’s `scaleBand` and `scaleLinear` defining the y- and x-axes, respectively. Data is loaded from a remote CSV file using D3’s `csv` method, and axis labels are formatted using D3’s `format` function to abbreviate values (e.g., converting billions to "B"). Tooltips provide exact population values on hover via the SVG `title` element.

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.