🌍 Public
Viewing a saved revision (read-only)
5d276ccfa13248fab760559c3a9515cb
Activity 6_Q1
This example shows a horizontal bar chart of the populations of 20 countries in 2010, with a green fill for each bar and a tooltip displaying the formatted population value. The chart uses React to render SVG elements, with D3’s `scaleBand` and `scaleLinear` for positioning and the `format` function to abbreviate tick labels (e.g., “1.2B”). Data is loaded from a CSV via D3’s `csv` function, and custom `AxisBottom`, `AxisLeft`, and `Marks` components generate the chart’s axes and rectangles.
AI-generated descriptionA demonstration of how to start using D3 version 6.