🌍 Public
Viewing a saved revision (read-only)
c7f4d6354f1e4e4dbd30929d5f7bcb46
Styling bar Chart
This example shows the top 10 most populous countries as horizontal bars, with country names on the y-axis and population on the x-axis, formatted in billions. The chart uses React to render SVG elements, with d3.scaleBand and d3.scaleLinear for positioning, and d3.format to abbreviate tick labels. Axes are drawn via custom React components that map scales to SVG lines and text, while bars include a native SVG `<title>` for tooltips. Data comes from the United Nations World Population Prospects 2019.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.