Making a bar chart
✓ Published0🌍 Public
This example shows a horizontal bar chart ranking the populations of ten countries, from China at the top to Mexico at the bottom. Using D3 v5, the code loads the data with `d3.csv`, maps population values with a linear scale, and positions bars with a band scale. It draws an SVG with `d3.axisLeft` for the country labels and a bottom axis created via a custom `axisBottom` call, while styling removes domain lines and ticks.
AI-generated descriptionMIT Licensed