viewof view = embed({
$schema: 'https://vega.github.io/schema/vega-lite/v3.json',
width: 360,
data: {
url: "https://apiteste.insa.gov.br/reservatorios/12172/monitoramento",
format: {"type": "json","property": "volumes"},
parse: {"DataInformacao": "utc:'%d/%m/%Y'"}
},
selection: {
a: {type: 'single'}
},
mark: "line",
encoding: {
x: {
timeUnit: "year",
field: "DataInformacao",
type: "temporal",
axis: {title: "Anos"}
},
y: {
aggregate: "mean",
field: "Volume",
type: "quantitative",
axis: {title: "Volume médio"}
},
color: {field: "Fonte", type: "nominal"}
}
})