Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart with D3

Public visualization

Viewing a saved revision (read-only)

1ae05452d1c84588a1e3d6fb7c870614

Making a Bar Chart with D3

0 stars0🌍 Public
WWhatTheFork85
Last edited Feb 24, 2020
Created on Feb 24, 2020

This example shows a horizontal bar chart of population figures for ten countries, ordered from largest to smallest. The visualization is built with D3 v5, using `d3.csv` to load the data, `scaleLinear` and `scaleBand` for the axes, and `axisLeft` and `axisBottom` to render tick marks. Population values are read as strings from the CSV and converted to numbers, then multiplied by 1000 before being mapped to bar widths. The SVG is styled with a steelblue fill for rectangles.

AI-generated description