Skip to main content
100%

Making a Bar chart using D3.js

✓ Published1🌍 Public
NNitin Vadhiya
Last edited Oct 16, 2021
Created on Oct 13, 2021

This example shows a horizontal bar chart of country populations using D3.js v5, with each bar’s length scaled linearly to the population value and country names on the y-axis. The SVG rendering uses `d3.scaleLinear` for the x-axis, `d3.scaleBand` for the categorical y-axis, and `d3.axisBottom` and `d3.axisLeft` to draw the axes. Data is loaded asynchronously from a CSV file, with population values converted from thousands to raw counts. Bars are appended as `rect` elements and styled with steelblue fill via CSS.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes