Making a Bar Chart
A bar chart displays population estimates for thirteen countries and two placeholder entries, with bars sized by population and colored on a red gradient. Hovering over a bar updates an HTML overlay with the country name and value. A green circle toggles an animation that transitions all bar widths between zero and their original lengths using a custom `transitionWidth` function. The visualization uses D3 v5 APIs including `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, and `.transition()`, with SVG rendering and data loaded from a local CSV file.
AI-generated descriptionThis bar chart shows population of the thirteen most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017.
Note: That link doesn't give data for the year 2018 but for the year 2015. In this example, I've used the data provided in the class (which is close to the downloaded data).