Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

aac8ee7b1af14e1c8d507c48f20e4de5

Making a bar chart

0 stars2🌍 Public
Kkhuton
Last edited Jan 18, 2021
Created on Jan 7, 2021
Forked from Lets make a face

This example shows a horizontal bar chart of the population of 20 countries, sorted from largest to smallest, using a bar for each nation. The chart is built with D3.js version 6, using `d3.select`, `d3.csv`, `d3.scaleLinear`, and `d3.scaleBand` to map population values to bar widths and country names to vertical positions. Rendered as an SVG, the chart displays axes generated by `d3.axisLeft` and `d3.axisBottom`, with bars styled via the `styles.css` file. Data comes from a local `data.csv` file.

AI-generated description