Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

f0c9d141dc2f44f1b09b48d913507f35

Fork of Refactored Bar Chart

0 stars0🌍 Public
KKIRRAN P L
Last edited Dec 6, 2023
Created on Dec 6, 2023

This example displays the top 10 most populous countries as horizontal bars, using React for component structure and D3 v5 for scales and data loading. The chart renders as SVG, with `d3.scaleBand` positioning categorical country labels on the y-axis and `d3.scaleLinear` mapping population values to bar widths. Axis components (`AxisBottom`, `AxisLeft`) draw tick marks and labels from the scales, while `Marks` generates each rectangle. Data comes from the United Nations World Population Prospects 2019 CSV, loaded asynchronously with D3’s `csv` function.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.