Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a barchart

Public visualization

Viewing a saved revision (read-only)

0744a8a5ac914f2b997507d401bc9c1a

Making a barchart

0 stars0🌍 Public
SSimonPlanje
Last edited Nov 3, 2020
Created on Nov 3, 2020

This example shows a horizontal bar chart of country populations, using D3 v6 to load data from a CSV file and render it as SVG rectangles. The visualization orders countries by descending population, with bar lengths scaled linearly and categorical spacing handled by `d3.scaleBand`. The code uses `d3.csv` to parse the data, `d3.scaleLinear` for the x-axis, `d3.axisLeft` and `d3.axisBottom` for labeled axes, and appends styled `<rect>` elements to the SVG.

AI-generated description