Vega how to make a count calculation for y-axis for an nominal data

I want make a simple diagram where I take data from index for 2 ordinal variables and using one of the ordinal variables as a key for x axis count the other ordinal variable on y axis and show it as a histogram.

this is what I did -

{
$schema: "https://vega.github.io/schema/vega/v3.0.json"
"title": "Event counts from all indexes"
"data": {
"url": {
"index": "apm*",
"body": {
"query" : {
"range" : { "@timestamp" : {"%timefilter%" : true }}
},
size : 1000
_source: ["@timestamp","lables.application", "lables.platform", "lables.correlation_id", "lables.is_error", "process.pid"]
}
}

format: {property: "hits.hits"}

}
"mark" : "bar"
"encoding": {
"x" : {
"field" : "datum._source['lables.application']", "type" : "nominal"
},
"y" : {
"field" : "datum._source['lables.platform'], "type" : "nominal"
}
}
}
}

Make sure you have corrected any typos. You have lables and colour which I don't believe are recognized.

Yes I corrected them but I still did not get a graph

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.