Hi,
My Vega code seems not working. I'm using Vega v2. I copied the sample online for window transform => rank operation, but the "rank" field is not showing up. I put a tooltip for field "exe" to show that it actually has a value. Please advise what is going wrong... This is driving me crazy!
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
config: {
kibana: {
tooltips: {centerOnMark: true, position: "top", padding: 20}
}
}
data: {
url: {
%context%: true
%timefield%: @timestamp
index: *
body: {
size: 10000
_source: ["@timestamp", "end_time", "step_path", "execution_duration"]
}
}
format: {property: "hits.hits"}
}
transform: [
{calculate: "datum._source.step_path", as: "Step"}
{calculate: "datum._source.execution_duration", as: "Duration(ms)"}
{filter: "datum._source.step_path != null"}
{
aggregate: [
{op: "average", format: ".2f", field: "Duration(ms)", as: "exe"}
]
groupby: ["Step"]
}
{
window: [
{op: "rank", as: "rank"}
]
sort: [
{field: "exe", order: "descending"}
]
groupby: ["Step"]
}
]
mark: {type: "bar"}
encoding: {
y: {
field: Step
type: ordinal
axis: {title: "Step"}
}
x: {field: "rank", type: "ordinal"}
tooltip: {field: "exe", type: "nominal"}
color: {field: "Step", type: "nominal", "nominalColorRange ": "category10"}
}
}