Skip to main content
100%

Making a barchart

✓ Published1🌍 Public
RRiccardo Pressiani
Last edited Oct 1, 2019
Created on Oct 1, 2019

This example shows a horizontal bar chart ranking the ten most populous countries, with population values read from a CSV file and displayed on a linear scale while country names appear on a band scale. It demonstrates fundamental D3.js DOM manipulation by selecting the SVG, appending a group for margins, and binding data to rectangle elements. The code uses `d3.csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to render the chart with steel-blue bars and labeled axes.

AI-generated description

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

MIT Licensed

Similar vizzes