D3.js Tutorial
✓ Published1🌍 Public
This example uses a bar chart to visualize the 2022 population of countries from a CSV dataset, with bars arranged horizontally by country and vertically by population size. The code sorts the data in descending order, renders the chart as SVG, and adds rotated country labels on the x-axis. It demonstrates loading D3 v5 via UNPKG, using `d3.csv` and `d3.max`, and building scales and axes with `d3.scaleBand`, `d3.scaleLinear`, and `d3.axisBottom`/`d3.axisLeft`.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed