Activity8_Task-1
✓ Published0🌍 Public
This example shows a horizontal bar chart comparing the 2020 populations of 30 countries, sorted alphabetically by country name. The chart uses a green fill for each bar and displays a tooltip with the population value formatted in a compact, human-readable scale (e.g., "1.2B") on hover. Rendered as an SVG via React, the visualization employs D3 v5’s `scaleBand` for the categorical y-axis, `scaleLinear` for the quantitative x-axis, and custom `AxisBottom`, `AxisLeft`, and `Marks` components to draw axes and rectangles. Data is fetched asynchronously from a CSV file using D3’s `csv` loader, with the population converted from a string to a numeric value before being plotted.
AI-generated descriptionA demonstration of how to start using D3 version 6.
MIT Licensed