Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars3🌍 Public
DDaniel Prevoznik
Last edited May 1, 2020
Created on Apr 30, 2020

This example shows a horizontal bar chart ranking the populations of the ten most populous countries, with country names on the y-axis and population values on the x-axis. It uses D3 v5’s `scaleLinear` and `scaleBand` to map data to pixel positions, `axisLeft` and `axisBottom` for ticks, and SVG `rect` elements filled with steelblue. The data is loaded from a local CSV file via `csv`, with population values multiplied by 1000 to reflect actual counts.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed