Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
CChangbeom Shim
Last edited Feb 24, 2022
Created on Feb 24, 2022

This horizontal bar chart displays the population of ten countries, ranging from China at the top with over 1.4 billion people to Mexico at the bottom with approximately 130 million. It uses D3's `scaleLinear` and `scaleBand` to map population values and country names to the SVG canvas, with `axisLeft` and `axisBottom` generating the axes. The code loads data from a CSV file via `csv` and renders steelblue rectangles, with an explicit `+d.population * 1000` conversion to reflect full population figures.

AI-generated description

This bar chart shows population of the top 10 most populaous .....

MIT Licensed

Similar vizzes