activity 6_Task 1
✓ Published0🌍 Public
This example shows a horizontal bar chart comparing the 2020 populations of 30 countries, with each bar labeled by country name on the y-axis and labeled numeric population values on the x-axis. The chart uses D3’s `scaleBand` and `scaleLinear` to position the bars, and SVG `<rect>` elements for the marks, with hover tooltips displaying the formatted population value. The visualization is built with React and rendered using SVG elements, with the data loaded asynchronously from a CSV file. The axes are customized with blue tick lines and formatted tick labels via D3’s `format` function.
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