🌍 Public
Viewing a saved revision (read-only)
2a3d9a042969433395825cac204a98d3
activity6q1
This example is a horizontal bar chart that displays the population of 20 countries in the year 2000, using the D3.js library within a React component. The chart renders as an SVG with a green bar for each country, scaled linearly by population. The code imports specific D3 functions for data loading (`csv`), scaling (`scaleBand`, `scaleLinear`), and formatting (`format`). A tooltip, created with an SVG `<title>` element, shows the population value when a bar is hovered.
AI-generated descriptionA demonstration of how to start using D3 version 6.