Skip to main content
100%

Making A Bar Chart

✓ Published0🌍 Public
CChip
Last edited Feb 24, 2020
Created on Feb 24, 2020

This example demonstrates the initial step of building a bar chart with D3 v5, showing empty SVG rectangles that are added to the page but not yet sized or positioned based on the data. The code loads population figures for ten countries from a CSV file using `d3.csv`, converts the population strings to numbers, and then appends `rect` elements to the SVG using data binding via `selectAll().data().enter()`. Each rectangle is currently assigned a fixed width and height of 500, and the chart is created with the SVG rendering approach and the `d3.select` API.

AI-generated description
MIT Licensed

Similar vizzes