barGraph
✓ Published0🌍 Public
This example shows a bar chart comparing the 2022 population of countries from a CSV dataset, with axis labels rotated and a tooltip displaying country and population on hover. The visualization loads D3 v5 via UNPKG and uses d3.csv, scaleBand, scaleLinear, axisLeft, and axisBottom to render SVG bars. Two buttons allow sorting the bars in ascending or descending population order by re-sorting the data array and re-rendering the chart.
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