🌍 Public
Viewing a saved revision (read-only)
7677f17a031249e7b928d95d86a34a34
Making A Bar Chart
This example displays a horizontal bar chart of population figures for ten countries, from China down to Mexico, using a clean SVG rendering with steel-blue bars. The visualization is built with D3 v6, loading the dataset via `d3.csv` and scaling the population values by one thousand before rendering. It employs `scaleLinear` for the population axis and `scaleBand` for the categorical country labels, with axes generated by `axisLeft` and `axisBottom`. The layout applies explicit margins and transforms to position the chart within a fixed 960-by-500 viewport.
AI-generated description