Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
Sshallowater
Last edited Jul 11, 2019
Created on Jul 11, 2019

This example displays a static horizontal bar chart of national populations, sorted by the descending values in the `data.csv` file. It shows the relative population sizes for ten countries, from China to Mexico. The visualization is built using D3 v5, loading the CSV data with the `csv` function and then rendering bars as SVG `rect` elements onto a 960-by-500 pixel canvas. The population values are converted from strings to numbers using the unary plus operator and scaled by a factor of 1000 before being used for the bar dimensions.

AI-generated description
MIT Licensed

Similar vizzes