Making a Bar Chart
✓ Published1🌍 Public
This example visualizes the 2018 populations of the ten most populous countries as a horizontal bar chart, with each bar’s length proportional to its population and a custom axis labeling numbers in billions. Built with D3 v5, it loads data from a CSV file, uses `scaleLinear` and `scaleBand` to map values, and renders axes via `axisBottom` and `axisLeft`. The SVG output includes a title and axis label, with gridlines and styled steel-blue bars, while the axis tick format converts large numbers to a readable "B" suffix.
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. It also demonstrates customization of D3 axes.
MIT Licensed