Skip to main content
100%

Customizing Axes

✓ Published1🌍 Public
AAbhijit Roy
Last edited May 14, 2020
Created on May 14, 2020
Forked from Making a Bar Chart

This example shows a bar chart of the 2018 population estimates for the top 10 most populous countries, with a horizontal layout so country names are clearly readable. The code uses D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to structure the visualization. It customizes the x-axis tick labels to abbreviate large numbers (e.g., converting 'G' to 'B' for billions) and adds grid lines via the `tickSize` option. Data is loaded from a CSV file using `d3.csv`.

AI-generated description

This 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 2019.

MIT Licensed

Similar vizzes