activity6 question9
This visualization shows the correlation between population and GDP across several countries from 1970 to 1974, with each bubble representing a country-year pair. The x-axis maps population in millions, the y-axis maps GDP in billion USD, while bubble radius encodes the year and color distinguishes countries. Users can hover over any bubble to see its exact country, year, population, and GDP values via a custom tooltip. The code uses d3.csv to load the data, d3.scaleLinear for axes and size scaling, d3.scaleOrdinal with d3.schemeTableau10 for colors, and includes legends for both the year-driven bubble sizes and country colors.
AI-generated descriptiond3.csv('bubblechart.csv').then((data) => { console.log(data); // Check if data is loaded properly // Existing code... });