vegaEmbed({
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {"values": filterdData},
"width": 700,
"height": 600,
"encoding": {"x": {"field": "Year", "type": "nominal"}},
"layer": [
{
"encoding": {
"color": {"field": "Entity", "type": "nominal"},
"y": {"field": "WasteExports", "type": "quantitative"}
},
"layer": [
{"mark": "line"},
{"transform": [{"filter": {"selection": "hover"}}], "mark": "point"}
]
},
{
"transform": [{"pivot": "Entity", "value": "WasteExports", "groupby": ["Year"]}],
"mark": "rule",
"encoding": {
"opacity": {
"condition": {"value": 0.3, "selection": "hover"},
"value": 0
},
"tooltip": [
{"field": "Africa", "type": "quantitative"},
{"field": "Asia", "type": "quantitative"},
{"field": "Australia", "type": "quantitative"},
{"field": "Europe", "type": "quantitative"},
{"field": "North America", "type": "quantitative"},
{"field": "South America", "type": "quantitative"},
{"field": "South Africa", "type": "quantitative"},
]
},
"selection": {
"hover": {
"type": "single",
"fields": ["Year"],
"nearest": true,
"on": "mouseover",
"empty": "none",
"clear": "mouseout"
}
}
}
]
})