Activity 7
✓ Published0🌍 Public
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.
MIT Licensed