Skip to main content
100%

Making a bar chart with D3.js

✓ Published0🌍 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
MIT Licensed

Similar vizzes