Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Basic Bar Chart - Country Population

Public visualization

Basic Bar Chart - Country Population

0 stars3🌍 Public
Ggmille22
Last edited Apr 20, 2020
Created on Apr 2, 2020

This example shows the population of ten countries using a horizontal bar chart, with countries sorted along the y-axis and population values mapped to bar width via `scaleLinear` and `scaleBand`. It applies a custom tick formatter that abbreviates large numbers with `format('.3s')`, replacing 'G' with 'B'. The SVG is rendered with D3 v5, using `csv` to load the dataset, `axisLeft` and `axisBottom` for axes, and margin-based layout. Data values are multiplied by 1000 after import, and the chart includes a title and population axis label.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed