Viewing a saved revision (read-only)
c71fda397f7f47cd94917b6cd5fc04eb
Reusable scatter plot with axis labels and tooltip
A scatter plot visualizes EU countries by urban population percentage and fertility rate, with hover tooltips displaying country names. The chart uses D3’s scaleLinear, extent, axisLeft, and axisBottom for axes and scaling, with circle elements bound to mapped data. Styled axis labels and a tooltip div are appended via D3 selections, while the data comes from a CSV of 2022 EU population statistics. The reusable scatterPlot function supports configurable dimensions, margins, and value accessors, with mouseover and mouseout events toggling tooltip opacity.
AI-generated descriptionReusable scatter plot with axis labels and tooltip inspired by Towards Reusable Charts.
Shows the Countries in the EU by population (2022) table of data.