Making a bar chart
✓ Published0🌍 Public
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.
MIT Licensed