Making a bar chart
✓ Published0🌍 Public
This example shows a horizontal bar chart ranking the ten most populous countries, with population values on the x-axis and country names on the y-axis. The code uses D3 v5’s `csv` loader to parse `data.csv`, then constructs the chart with `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`. Bars are rendered as SVG `rect` elements, with dashed grid lines from a custom tick size and a formatted population axis using `format('.3s')`. Styling is applied via external CSS.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a bar chart.
MIT Licensed