Making a Bar Chart
✓ Published0🌍 Public
This example displays the population of the top 10 most populous dog breeds as a horizontal bar chart, using data from a local CSV file. The visualization uses d3.scaleLinear and d3.scaleBand to map population and breed names to x and y positions, with d3.axisLeft and d3.axisBottom rendering the axes. Bars are appended as SVG rectangles whose widths are proportional to population values, and the chart is rendered with a steelblue fill and a fixed SVG viewport.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017.
MIT Licensed