Skip to main content
100%

Creating a bar Chart

✓ Published1🌍 Public
AAjit Singh
Last edited Dec 14, 2020
Created on Dec 8, 2020

This example shows a horizontal bar chart ranking the populations of ten countries from a CSV file, using rectangular bars scaled to population values on an x-axis. It relies on D3 v5 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load the data, map values, and render axes. The SVG is drawn with a margin-based layout, where bands represent countries on the y-axis and bar widths reflect population sizes. The visualization demonstrates a basic, reusable pattern for building bar charts with D3's data-join and SVG rendering.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes