question2(task-1)
✓ Published0🌍 Public
This horizontal bar chart displays the populations of 20 countries in 2010, with each bar labeled by country name and population value, sorted in descending order from China to France. The visualization uses D3.js v7 with an SVG rendering approach, employing `d3.scaleLinear` for the x-axis population scale and `d3.scaleBand` for the categorical y-axis of country names. The code draws axis ticks via `d3.axisLeft` and `d3.axisBottom`, formats population labels with `d3.format('.2s')`, and includes hover effects that change bar colors through CSS.
AI-generated descriptionMIT Licensed