Plot.plot({
marks: [
Plot.areaY(climateFiltered, {
x: "Year",
y: { scale: 'linear' },
y: "average_value_CO2 emissions (kt)",
fill: "Country Name",
fillOpacity: 0.7,
tip: true
}),
Plot.tip(climateFiltered, Plot.selectMaxY({
x: "Year",
y: "average_value_CO2 emissions (kt)",
stroke: "Country Name",
anchor: "right",
fill: "yellow"
})),
Plot.text(climateFiltered, Plot.selectLast({
x: "Year",
y: "average_value_CO2 emissions (kt)",
text: "Country Name",
fill: "Country Name"
}))
],
color: { legend: true }
})