Making a Bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of population by country, with bars scaled linearly along the x-axis and sorted alphabetically along the y-axis. The code uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand to compute positions, and d3.axisLeft and d3.axisBottom to render the axes via SVG. The bars are appended as SVG rect elements with a steelblue fill.
AI-generated descriptionMIT Licensed