Reusable scatter plot with axis labels and tooltip
✓ Published0🌍 Public
TToly
Last edited Dec 30, 2022
Created on Dec 30, 2022
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.
MIT Licensed