Making a Bar Chart
✓ Published1🌍 Public
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 descriptionMIT Licensed