Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

7ee2ba680fad44649b3a462981a0895c

Making a Bar Chart

0 stars0🌍 Public
BBraja Gopal Das
Last edited Apr 9, 2019
Created on Apr 9, 2019

This example shows a horizontal bar chart of country populations, with bars scaled to population size and country names on the y-axis. Using d3.csv to load data.csv, it parses population values as numbers, then applies d3.scaleLinear and d3.scaleBand for positioning. The chart renders in SVG, with d3.axisLeft and d3.axisBottom generating labeled axes and tick formatting via d3.format('.3s') for compact labels. Rect elements are appended and sized using the scales, with steelblue fill from CSS.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.