Making a Bar Chart
✓ Published2🌍 Public
This example shows a horizontal bar chart ranking the populations of ten countries, from China at the top to Mexico at the bottom. The visualization uses D3 v6 with the `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` APIs to position bars and axes within an SVG. Population values are loaded from a local CSV file and scaled by 1,000. The chart renders with steel-blue bars and labeled text, with margins applied to the SVG’s fixed dimensions.
AI-generated descriptionMIT Licensed