🌍 Public
Viewing a saved revision (read-only)
12500c3fc72b4349ab3a52b797ffe128
Making a bar chart
This example demonstrates how to build a simple bar chart from a CSV file using D3 v5. The chart displays population data for several countries, with horizontal bars whose widths are proportional to each country’s population. The code uses `d3.csv`, `scaleLinear`, and `scaleBand` to map the data to SVG rectangles, while the rendering is done entirely with SVG elements in an HTML page. The data is loaded from `data.csv` and scaled by a factor of 1000 before being visualized.
AI-generated descriptionAn example showing the capabilities of VizHub.