🌍 Public
Viewing a saved revision (read-only)
fa4dd036361341308ae9b7816d4f6424
Making a bar chart. Customizing the axis.
This example shows a horizontal bar chart ranking the ten most populous countries, with each bar’s length representing population in thousands and a customized bottom axis displaying abbreviated tick labels (e.g., “1B” for billions). The chart uses d3.csv to load the data, then applies scaleLinear and scaleBand for positioning, while axisBottom and axisLeft generate the axes. Grid lines are drawn via tickSize(-innerheight), and the axis labels and title are manually added as SVG text elements. The y-axis ticks are stripped of their default lines and domain for a cleaner look.
AI-generated description