grafico = Plot.plot({
y: {
label: "↑ living planet index",
grid: true,
nice: true,
},
x: {
label: "anno →"
},
marginTop: 20,
marginRight: 40,
marginBottom: 30,
marginLeft: 40,
marks: [
Plot.ruleY([0]),
Plot.lineY(country, {
x: "Year",
y: "living_planet_index_average",
stroke: "#BEBEBE"
}),
Plot.lineY(country, {
x: "Year",
y: "living_planet_index_upper",
stroke: "#4e79a7"
}),
Plot.lineY(country, {
x: "Year",
y: "living_planet_index_lower",
stroke: "#e15759"
}),
Plot.text(country, Plot.selectLast({x: "Year", y: "living_planet_index_lower", text: d => "lower", textAnchor: "start", dx: 3})),
Plot.text(country, Plot.selectLast({x: "Year", y: "living_planet_index_upper", text: d => "upper", textAnchor: "start", dx: 3})),
Plot.text(country, Plot.selectLast({x: "Year", y: "living_planet_index_average", text: d => "average", textAnchor: "start", dx: 3}))
]
})