🌍 Public
Actvity6_question1
This example displays a horizontal bar chart of population data for the year 2000, with the top ten countries ordered along the y-axis and population values mapped to bar lengths on the x-axis. It uses React to render SVG elements and imports `scaleBand` and `scaleLinear` from D3 to compute the scales, while `format` from D3 converts axis tick labels from raw numbers to abbreviated billions. The chart reads its data from an external CSV file via the `csv` function, and a tooltip on each bar shows the formatted population value.
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
Comments
Sign in to join the discussion.