🌍 Public
Viewing a saved revision (read-only)
2c0eac1b88fa4b4b9908b829c579d14a
Task8_Question1_b
This example shows a bar chart of the population of 20 countries in 2010, using a horizontal layout where each bar’s length encodes the population value and country names label the y-axis. The visualization is rendered as SVG using React, with scales from d3.scaleBand and d3.scaleLinear mapping data to positions and sizes. The code retrieves CSV data via d3.csv, formats tick labels with d3.format, and builds axes from React components that generate SVG elements. The bars include a native SVG title tooltip, displaying the formatted population value on hover.
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.