Activity 6_Task 1 (Q1.1)
✓ Published0🌍 Public
This example shows a horizontal bar chart comparing the population of ten countries in the year 2000, using a dataset loaded from a GitHub-hosted CSV file. The React application renders the chart as an SVG, with rectangular bars scaled by population values on a linear axis and country names positioned on a band axis. The code imports `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` from the D3 v5 library, leveraging React's `useRef` and `useEffect` hooks to attach the axes to the SVG 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