Skip to main content
100%

Custominzing Axes

✓ Published1🌍 Public
Sstephanie0215
Last edited Sep 23, 2022
Created on Sep 23, 2022
Forked from Making a bar chart

This example visualizes the top 10 most populous countries using a horizontal bar chart, with country names on the y-axis and population values on the x-axis. The chart uses D3 v7’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to render the bars and axes, with custom tick formatting that converts large numbers into abbreviated units. Data is loaded from a CSV file via `d3.csv`, and population values are multiplied by 1000 before plotting. The SVG output includes axis labels, a title, and styled grid lines, all defined in a separate stylesheet.

AI-generated description

T

MIT Licensed

Similar vizzes