Skip to main content
100%

Activity6_population

✓ Published0🌍 Public
DDouglas mochama
Last edited Apr 14, 2024
Created on Apr 14, 2024

This example visualizes the top ten countries by population in 2000 as a horizontal bar chart. Using a d3.scaleLinear for the x-axis and d3.scaleBand for the y-axis, it renders SVG rectangles with steelblue fill. The code loads data from a CSV via d3.csv, sorts it descending, and formats axis tick labels in millions. Axes are created with d3.axisBottom and d3.axisLeft, with custom text labels for both dimensions.

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.
MIT Licensed

Similar vizzes