Skip to content

Instantly share code, notes, and snippets.

@JuanBarros2
Created November 7, 2017 23:22
Show Gist options
  • Save JuanBarros2/af1e0aa120b5f2ec8aedaadd6925ce9e to your computer and use it in GitHub Desktop.
Save JuanBarros2/af1e0aa120b5f2ec8aedaadd6925ce9e to your computer and use it in GitHub Desktop.
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"title": "Visualização retirada de dados da AESA/ANA",
"data": {
"url": "https://api.insa.gov.br/reservatorios/12172/monitoramento",
"format": {
"type": "json",
"property": "volumes",
"parse": {
"DataInformacao": "utc:'%d/%m/%Y'"
}
}
},
"vconcat": [{
"width": 800,
"height": 400,
"mark": "area",
"encoding": {
"x": {
"timeUnit": "yearmonthday",
"field": "DataInformacao",
"type": "temporal",
"scale": {
"domain": {"selection": "brush"}
},
"axis": {"title": "Tempo"}
},
"y": {
"field": "Volume",
"axis": {"title": "Volume"},
"type": "quantitative"
},
"color":{
"type":"nominal",
"field":"Fonte"
}
}
}, {
"width": 800,
"height": 100,
"mark": "area",
"selection": {
"brush": {"type": "interval", "encodings": ["x"]}
},
"encoding": {
"x": {
"timeUnit": "yearmonthday",
"field": "DataInformacao",
"type": "temporal",
"axis": {"title": "Tempo"}
},
"y": {
"field": "VolumePercentual",
"type": "quantitative",
"axis": { "title": "Volume (%)"}
},
"color":{
"type":"nominal",
"field":"Fonte"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment