Skip to main content
100%

Basic Bar Chart - Country Population

✓ Published3🌍 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
MIT Licensed

Similar vizzes