Making a Bar Chart
✓ Published1🌍 Public
This example demonstrates how to build a simple horizontal bar chart using D3 v7, displaying population data for ten countries from a CSV file. The chart shows each country’s population as a steelblue rectangle, scaled linearly along the x-axis and positioned by a band scale on the y-axis. The code uses D3 modules like `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`, rendering SVG elements within a 960x500 viewport. Population values are converted from thousands to actual counts before being passed to the scales.
AI-generated descriptionA demonstration of how to start using D3 version 6.
MIT Licensed