🌍 Public
Viewing a saved revision (read-only)
cb6090a55788460eaa1af5eea563fc2c
Making BarChart
This example shows a horizontal bar chart of the top 10 most crowded countries, ranked by population on a linear scale. The code uses D3 v5 to load CSV data, apply a linear scale for the x-axis and a band scale for the y-axis, and render SVG rectangles for bars. It formats tick labels with `d3.format` to abbreviate large numbers (e.g., "G" replaced with "B") and draws gridlines using the axis’s tick size.
AI-generated description