Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

3f84c444a2ad48ec9484c2bc94430bfa

Making a Bar Chart

0 stars1🌍 Public
PPedro Ernesto Tramontina
Last edited Mar 25, 2020
Created on Mar 24, 2020
Forked from Testing

This example shows a horizontal bar chart of population by country, using a CSV dataset ordered from China to Mexico. D3 v5 functions `csv`, `scaleLinear`, and `scaleBand` map population values to bar widths and country names to row heights, while `axisLeft` and `axisBottom` render the axes. The SVG renders steel-blue rectangles with D3’s `selectAll` and data joins, with a fixed 960×500 viewport and margins defining the inner plot area.

AI-generated description