Skip to main content
100%

make a bar chart

✓ Published1🌍 Public
Ddaniel
Last edited Oct 6, 2023
Created on Sep 18, 2023
Forked from Hello VizHub

This example displays a horizontal bar chart of population by country for the top ten most populous nations. Built with D3 v7 using a data-driven approach, it loads population figures from a local CSV file and renders SVG bars with custom scales. The code demonstrates key D3 API usage including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to construct the chart layout. The bars are colored steel blue via CSS, and population values are converted from strings to numbers during data preparation.

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