Skip to main content
100%

Making a bar chart

✓ Published0🌍 Public
DDmytro Tyshchenko
Last edited Nov 19, 2021
Created on Nov 19, 2021

This example shows a horizontal bar chart of population data for ten countries, using scaled bar widths to represent each country’s population in thousands. The visualization is built with D3 v5, using `d3.csv` to load the data, `d3.scaleLinear` for the x-axis, and `d3.scaleBand` for the y-axis categories. SVG rectangles are appended to a grouped `<g>` element with margins, and the population values are parsed and multiplied by 1000 before rendering. The chart displays the data directly without axes or labels, focusing on the bar lengths.

AI-generated description
MIT Licensed

Similar vizzes