🌍 Public
Viewing a saved revision (read-only)
f568d10d1bb544cb8c729523fe299400
Making a Bar Chart
This example demonstrates a basic bar chart of country populations, loading data from a CSV file and rendering rectangles into an SVG container. The code uses d3.csv to parse the data, d3.scaleLinear for the x-axis scale, and d3.max to compute the domain. Although the bars are initially appended with fixed widths and heights, the x-scale is correctly configured to map population values to the full SVG width. The chart uses d3 v5 and follows a simple data-join pattern with selection.enter().
AI-generated description