Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart with D3.js

Public visualization

Making a bar chart with D3.js

0 stars0🌍 Public
VVinod-VIX
Last edited Nov 3, 2020
Created on Nov 3, 2020

This example shows a horizontal bar chart of the ten most populous countries, using population totals from a CSV file. The chart displays each country’s name on the y-axis and its population on the x-axis, with bars rendered as SVG rectangles. The code uses d3.csv to load data, d3.scaleLinear for the x-axis, d3.scaleBand for the y-axis, and d3.axisLeft and d3.axisBottom to generate the axes. Bars are filled with steelblue via CSS, and the visualization is built with d3.v6 in an SVG container.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed