Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

35ba49d5c6da42ce98d5d75e8107bae3

Making a Bar Chart

0 stars1🌍 Public
SsowmyaSG
Last edited Jun 11, 2019
Created on Jun 11, 2019
Forked from Making a Bar Chart

This example shows a purple bar chart of sound levels in decibels recorded across a seven-day period. The chart loads and maps data from a CSV file using d3.csv, then scales the values with d3.scaleLinear and d3.scaleBand. It renders axes through d3.axisLeft and d3.axisBottom, and appends rectangles to an SVG canvas to represent each day’s measurement. The bars are drawn dynamically based on the data, with a fixed chart margin and explicit width and height set in the SVG element.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017.