Hello,
I have used facet as well as layer in below code, I tried to limit no. of columns to 2 but it wasn't working.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"name": "trellis_barley",
"description": "The Trellis display by Becker et al. helped establish small multiples as a “powerful mechanism for understanding interactions in studies of how a response depends on explanatory variables”. Here we reproduce a trellis of Barley yields from the 1930s, complete with main-effects ordering to facilitate comparison.",
"data": {"url": "data/barley.json"},
"facet": {
"field": "site",
"type": "ordinal",
"columns":2
},
"spec":{
"layer":[{
"mark": "point",
"height": {"step": 12},
"encoding": {
"y": {
"aggregate": "median",
"field": "yield",
"type": "quantitative",
"scale": {"zero": false}
},
"x": {"field": "variety", "type": "ordinal", "sort": "-x"},
"color": {"field": "year", "type": "nominal"}
}
},
{
"mark": "line",
"height": {"step": 12},
"encoding": {
"y": {
"aggregate": "sum",
"field": "yield",
"type": "quantitative",
"scale": {"zero": false}
},
"x": {"field": "variety", "type": "ordinal", "sort": "-x"},
"color": {"value": "#000000"}
}
}] ,"resolve": {"axis": { "y": "independent"}}},
"resolve": {
"scale": {"y": "independent"},
"axis": {"y": "independent"}
}
}
output :
I require the output in this manner, where data is wrapped in 2 columns. Any suggestions on how can I get it ?