🌍 Public
Viewing a saved revision (read-only)
97b76c84a4204f18bbf5b450ca6224a2
Activity 7
This example displays a horizontal bar chart of 2020 population data by country, with green bars and blue axis ticks styled via CSS. It uses React for component structure, rendering SVG elements like `rect`, `text`, and `line` directly. D3 v5 utilities such as `scaleBand`, `scaleLinear`, `max`, and `format` handle scaling and tick formatting, with custom `AxisBottom` and `AxisLeft` components defining the axes via JSX. The chart loads data through a custom `useData` hook and includes tooltips via 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.