barGraph
✓ Published0🌍 Public
This bar graph displays the 2022 population for each country from a CSV dataset. When hovering over a bar, a tooltip reveals the country name and its population. The chart uses an SVG canvas and is built with D3.js v5, loading data via `csv()` and rendering axes and bars through `scaleBand`, `scaleLinear`, `axisBottom`, and `axisLeft`. The interface includes two buttons for sorting the bars in ascending or descending order, though the sorting logic is incomplete in the code.
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