Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity6_population

Public visualization

Viewing a saved revision (read-only)

e2b75915b1404b7595e012b541a92082

Activity6_population

0 stars4🌍 Public
DDouglas mochama
Last edited Apr 14, 2024
Created on Apr 14, 2024

This example visualizes the top 20 countries by population in 2010 using a horizontal bar chart. The code loads CSV data from a GitHub gist via `d3.csv`, sorts it in descending order, and renders SVG bars with `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis. Axes are generated with `d3.axisBottom` and `d3.axisLeft`, while tick labels are formatted in millions. The chart includes axis labels and uses steelblue bars, demonstrating D3 v7’s data binding and SVG rendering capabilities.

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.