Transition in bar chart : Easy interaction using CSS property transition
This visualization displays the top 10 most populous countries based on 2018 United Nations estimates, using horizontal bars rendered as SVG rectangles. It builds on a basic bar chart by adding a CSS transition property that smoothly changes bar fill color from steelblue to red on hover, demonstrating simple interaction without D3's transition system. The code uses d3.csv to load population data, d3.scaleLinear and d3.scaleBand for scaling, and d3.axisLeft and d3.axisBottom with custom tick formatting for the axes. The styling in styles.css handles the transition effect.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.
See also the first bar chart visualization that this one builds on: Making a Bar Chart.