Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Making a bar chart

0 stars1๐ŸŒ Public
AAshutosh Singh
Last edited Jan 25, 2021
Created on Jan 21, 2021

This example shows a horizontal bar chart of country populations using a bar for each nation, drawn as SVG rectangles scaled by population value. The code loads data from a CSV file and uses D3 v6 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to construct the scales and axes. Bars are appended via a data join, with population values parsed and multiplied by 1000, and the chart is rendered with margins and a steelblue fill.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed