Question1
✓ Published0🌍 Public
This example shows a horizontal bar chart comparing the populations of the top 10 countries in the year 2000, with numeric labels formatted using shorthand notation (e.g., "1.2B"). It is built with React and D3 v5, using `scaleBand` and `scaleLinear` to map country names and population values to SVG rectangles. Data is loaded asynchronously from a CSV file via D3’s `csv` function, filtered to the first ten rows, and rendered with custom `AxisBottom`, `AxisLeft`, and `Marks` components. The chart also includes interactive tooltips using SVG `<title>` elements.
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