Skip to main content
100%

making a barchart

✓ Published1🌍 Public
Mmoowaffles
Last edited Feb 14, 2021
Created on Feb 13, 2021

This example shows a horizontal bar chart of country populations, comparing 12 nations from a CSV dataset. The bars are rendered as SVG rectangles, with country names on the y-axis and population values on the x-axis. Using d3’s `csv` loader, the data is parsed and scaled with `scaleLinear` and `scaleBand`, while axes are generated via `axisLeft` and `axisBottom`. Rectangles are appended to the SVG group with attributes mapped from the scales, and the chart is styled with a steelblue fill.

AI-generated description
MIT Licensed

Similar vizzes