Skip to main content
100%

Making a Bar Char

✓ Published0🌍 Public
XXinyeBai4
Last edited Jul 23, 2019
Created on Jul 23, 2019

This example shows a static bar chart of country populations from a CSV file, using SVG rectangles to represent each value. The code imports `select` and `csv` from D3 v5 to load the data and bind it to the DOM, converting string population numbers to integers before rendering. The current implementation includes only the data-loading and parsing steps, with a placeholder selection call (`svg.selectAll('rect')`) that does not yet bind or draw the bars. The chart uses a fixed 960x500 SVG canvas and relies on D3’s `csv` promise to handle the asynchronous file import.

AI-generated description

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

MIT Licensed

Similar vizzes