Joint bar graph in vega

I want to draw a joint bar graph for my success failure count for each airline in vega-lite Can anyone guide me please?

{

"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data":{
"url":{
"index":"kibana_sample_data_flights",
"body":{
"aggs": {
"carrier": {
"terms": {
"field": "Carrier",
"order": {
"_count": "desc"
},
"size": 5
},
"aggs": {
"flightDelay": {
"terms": {
"field": "FlightDelay",
"order": {
"_key": "desc"
},
"size": 5
}
}
}
}
},
"size": 0,
"_source": {
"excludes":
},
"stored_fields": [
"*"
],
"script_fields": {
"hour_of_day": {
"script": {
"source": "doc['timestamp'].value.hourOfDay",
"lang": "painless"
}
}
},
"docvalue_fields": [
{
"field": "timestamp",
"format": "date_time"
}
],
"query": {
"bool": {
"must": ,
"filter": [
{
"match_all": {}
},
{
"match_all": {}
},
{
"range": {
"timestamp": {"%timefilter%":true}
}
}
],
"should": ,
"must_not":
}
}
}

},

"format":{"property":"aggregations.carrier.buckets"}
},
"transform": [
{"calculate": "datum.key", "as": "airlineName"},
{"calculate": "datum.flightDelay.buckets[0].doc_count", "as": "trueCount"},
{"calculate": "datum.flightDelay.buckets[1].doc_count", "as": "falseCount"},
{"calculate": "datum.doc_count", "as": "totalCount"}
],
"mark":"bar",
"encoding":{

"x": {
  "field": "airlineName", "type": "nominal"
},
"y":{
   "field": "trueCount", "type": "quantitative"

}
}
}

cc @nyuriks

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