Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity6_population

Public visualization

Viewing a saved revision (read-only)

a50d1323de9244a9ab1e8fe4b62e6b95

Activity6_population

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

This example shows a horizontal bar chart of the populations of 20 countries in 2010, ordered by country name. The chart uses D3’s `scaleBand` and `scaleLinear` to map countries and population values to SVG rectangles, with axes built from custom React components. Population values are formatted with D3’s `format` function, converting values like “1.2G” to “1.2B”. The data is loaded asynchronously from a CSV file via `d3.csv`, and the rendering is done through React with SVG, using a light green fill for the bars and tooltips provided by SVG `<title>` elements.

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.