Skip to main content
100%

Making a bar chart

✓ Published2🌍 Public
Kkhuton
Last edited Jan 18, 2021
Created on Jan 7, 2021
Forked from Lets make a face

This example shows a horizontal bar chart of the population of 20 countries, sorted from largest to smallest, using a bar for each nation. The chart is built with D3.js version 6, using `d3.select`, `d3.csv`, `d3.scaleLinear`, and `d3.scaleBand` to map population values to bar widths and country names to vertical positions. Rendered as an SVG, the chart displays axes generated by `d3.axisLeft` and `d3.axisBottom`, with bars styled via the `styles.css` file. Data comes from a local `data.csv` file.

AI-generated description
MIT Licensed

Similar vizzes