🌍 Public
Viewing a saved revision (read-only)
21a063bbc5024a14afd42482b73ba4fb
Task-8(Question-1.2)
This example displays a horizontal bar chart ranking the populations of the top 20 countries from a CSV dataset, with bars colored light green and axis lines in blue. It loads the data using D3’s `csv` function and renders the chart as SVG elements with React, using `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis. The chart includes formatted tick labels that convert values like billions using D3’s `format` API, and each bar contains a native SVG `<title>` tooltip showing the 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.