-
-
Save marcosvrrs/6f4460c7d794f447f58e465c6dcbe42d to your computer and use it in GitHub Desktop.
The vega-lite code that I was trying to facet/small multiples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
$schema: https://vega.github.io/schema/vega-lite/v4.json | |
title: Visu interessante | |
// Define the data source | |
data: { | |
url: { | |
/* | |
Kibana has a special handling for the fields surrounded by "%". They are processed before the the query is sent to Elasticsearch. This way the query becomes context aware, and can use the time range and the dashboard filters. | |
*/ | |
// Apply dashboard context filters when set | |
%context%: true | |
// Filter the time picker (upper right corner) with this field | |
%timefield%: timestamp | |
index: index_do | |
body: { | |
aggs: { | |
sube: { | |
terms: { | |
field: "iName.keyword" | |
// "size": 10 | |
} | |
aggs:{ | |
transacoec: { | |
terms: { | |
field: "mo.keyword" | |
// size: 13 | |
} | |
} | |
} | |
} | |
} | |
size: 0 | |
} | |
} | |
format: {property: "aggregations.sube.buckets"} | |
} | |
// facet: { row: {field: "iName.keyword"}} | |
// spec: { | |
mark: bar | |
encoding: { | |
x: { | |
field: key | |
type: nominal | |
sort: -y | |
axis: {title: false} // Customize X axis format | |
} | |
y: { | |
field: doc_count | |
type: quantitative | |
axis: {title: "Quantidade de M"} | |
}, | |
} | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment