First Bar Chart
✓ Published2🌍 Public
This example displays a horizontal bar chart of food sales, using D3.js (v5) with SVG rendering. The chart maps food types to a band scale and sales numbers to a linear scale, with axes generated via `axisLeft` and `axisBottom`. Population data for the top 10 countries is sourced from the 2017 World Population Prospects, though the code loads `moreData.csv` with food sales figures. Bars are drawn as SVG rectangles with steelblue fill, and the layout includes explicit margins and padding.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in World Population Prospects 2017.
MIT Licensed