Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

5d7b5890e15e47fd99f4d32a8d8e2cc2

Making a bar chart

0 stars1🌍 Public
AAshutosh Singh
Last edited Jan 25, 2021
Created on Jan 21, 2021

This example shows a horizontal bar chart of country populations using a bar for each nation, drawn as SVG rectangles scaled by population value. The code loads data from a CSV file and uses D3 v6 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to construct the scales and axes. Bars are appended via a data join, with population values parsed and multiplied by 1000, and the chart is rendered with margins and a steelblue fill.

AI-generated description