🌍 Public
Viewing a saved revision (read-only)
7e239f2a3c79485c82a333ea2adc3ec1
Making a Bar Chart (Outtake)
This example displays a bar chart of each continent's 2018 population, sourced from Wikipedia, with values rendered as horizontal bars. The visualization uses D3 v5’s `scaleLinear` and `scaleBand` to map population counts to bar widths and continent names to vertical positions, while `format` adds comma separators. The SVG output includes text labels for each continent and its population, with bars styled via the `select` and `append` API.
AI-generated descriptionThis bar chart shows the population of each continent. The data comes from Wikipedia: List of continents by population.